Running SQL Scripts from Shell script - Need insight!
I've a script that fetches various values from the database as below:
#! /bin/ksh
$conn="user/pwd@service_name"
`sqlplus -s << $conn EOF1
@xyz.sql
@pqr.sql
@abc.sql
EOF1`
The output of the script should generate txt files containing the results from queries which are further manipulated for display / reporting.
However, when the scripts executes, Oracle throws an exception
SP-0734 : not found .. as against running a direct query within the HERE docs (<< EOF1 EOF1). The same exception doesn't arise when the entire block is assigned to a return variable.
Can someone focus on why this shows up?
TIA
Sirisha
|