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

Explain about gui scripting?

1103


What is the significance of $#?

1109


What is in a script?

1024


What happens when you type ls?

1004


How to write a function?

1042


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

1292


Write down the syntax of "for " loop

1111


I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.

1038


What is the best scripting language?

1036


What does it mean to debug a script?

1064


What are the various stages of a linux process it passes through?

1186


What is the use of "$?" Sign in shell script?

1174


Why is a script important?

1076


What will happen to my current process when I execute a command using exec?

1061


What are the four fundamental components of every file system on linux?

1685