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

c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

3696


What are the advantages of shell script?

969


What is the syntax of "nested if statement" in shell scripting?

1039


What is bash shell command?

960


What is batch file programming?

1102


What are zombie processes?

970


What is echo in shell?

1045


What are the two files of crontab command?

1140


Write the syntax for "if" conditionals in linux?

1051


How can you find out how long the system has been running?

844


What are the different communication commands available in the shell?

909


What is shell scripting used for?

933


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

2144


What does $1 mean in bash?

1025


What language is shell scripting?

971