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 does path stand for?

640


What is a beat in a script?

548


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1685


How do you find out What is your shell?

592


How do I run a shell script in powershell?

554






What language is bash?

491


What is the use of break command?

590


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.

801


Is shell scripting easy to learn?

571


determine the output of the following command: echo ${new:-variable}

546


What is a boot block?

583


What are filters explain sort with all the options available?

936


What is shell and terminal?

575


How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }

1857


What is the conditional statement in shell scripting?

661