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
What does path stand for?
What is a beat in a script?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
How do you find out What is your shell?
How do I run a shell script in powershell?
What language is bash?
What is the use of break command?
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.
Is shell scripting easy to learn?
determine the output of the following command: echo ${new:-variable}
What is a boot block?
What are filters explain sort with all the options available?
What is shell and terminal?
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); }
What is the conditional statement in shell scripting?