The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-28-2006
manthasirisha manthasirisha is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 59
Question 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