Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how do you write sql queries using shell script
for eg:- we have databae table like EMPNO,ENAME,SAL,DEPTNO
columns in EMP table how you display EMPNO,SAL FIELDS from emp
in SHELL SCRIPT please explain with an example

Answer Posted / vikas

U can use .
Database coumns are : Emp.No, Emp. Name, Salary, Dept.No.
$ cut -f 1,3 <filename> > temp.txt

This will print two columns: emp/ No and salarya and store
it in fiile temp.txt in same directory.

If u want to sort them:
$ cut -f 1,3 <filename> > temp.txt
$ sort -otemp.txt temp.txt

Is This Answer Correct ?    5 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we write bin bash in shell scripts?

977


What is the best scripting language?

984


Why are there shells on the beach?

1082


How do we delete all blank lines in a file?

1065


Calculate a real number calculation directly from the terminal and not any shell script.

1173


What is bash eval?

958


What makes c shell a more preferable option than the bourne shell?

935


How do I run a shell script in powershell?

1082


I have 2 files and I want to print the records which are common to both.

1125


What is shell prompt?

983


What does $@ mean in shell?

981


What is a beat in a script?

1009


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

1038


What is ms powershell?

982


What is subshell?

902