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 / nitesh bhope

sqlplus username/userpassword@oracle<<eof
>select * from emp;
>select empno,ename,sal,deptno;
........what ever commands u wanna execute of sql u can
write here
>hit ctrl+d

these are called as here documents

Is This Answer Correct ?    11 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scripting used for?

992


How do I stop script errors?

1041


Write a command sequence to find the count of each word?

940


What is shell terminal?

901


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

1109


How to debug the problems encountered in the shell script/program?

1069


What is echo in shell?

1046


What language is bash written in?

947


Explain about sourcing commands?

1032


How do I run a script on mac?

1028


How do I run a .sh file?

964


What does $0 mean in shell script?

937


Is shell and terminal the same?

993


Print the 10th line without using tail and head command.

2110


How to find duplicate record in file using shell script?

1321