Answers

Question and Answer:

  Home  Scripting

⟩ Explain how to fetch two values from database into two variables in shell scripting?

In order to get 1 value from DB and assign it to variable in shell script i use following syntax:

sqlplus /nolog << EOF | read xyz

SET LINESIZE 100

SET PAGESIZE 50

SELECT emp_sal

FROM emp

where emp_id=789;

EOF

hence, xyz variable gets emplyoee salary.

 278 views

More Questions for you: