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 the use of "$#" in shell scripting?

736


What is a boot block?

756


What is the difference between scripting and coding?

732


What are the different types of shell scripting?

758


What is bash command used for?

772


Please give me example of " at command , contrab command " how to use

2529


Explain about login shell?

808


What is the first line in a shell script?

777


How do you find out What is your shell?

771


What is awk in shell scripting?

784


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

755


What is awk script?

719


Write a script to print the first 10 elements of fibonacci series.

2075


Can shell script run on windows?

759


How do we delete all blank lines in a file?

784