Home » Infrastructure » Unix » Calling a sql (*.sql) script in a Procedure - in Unix Env.
Calling a sql (*.sql) script in a Procedure - in Unix Env. [message #124055] Thu, 16 June 2005 01:57 Go to next message
csriram66
Messages: 1
Registered: June 2005
Junior Member
Hi

I have a procedure which creates a DDL script (*.sql) dynamically using UTL utility and writes to unix box in UTL_DIR.

Now, being in the same procedure I want to run this sql script that was created.

Please let me know how to accomplish this. If possible can you put a sample code please.

Thanks
Regards
Sriram
Re: Calling a sql (*.sql) script in a Procedure - in Unix Env. [message #124091 is a reply to message #124055] Thu, 16 June 2005 07:00 Go to previous message
smenon
Messages: 4
Registered: June 2005
Location: UK
Junior Member
RunSQLCommand()
{
command=$1
# Call SQL*Plus
SQL_RESULTS=`${ORACLE_HOME}/bin/sqlplus -s / 2>/dev/null <<!
SET HEADING OFF
SET FEEDBACK OFF
SET LINESIZE 1024
SET.....
${command}
exit!`
}

$1 could be @abc.sql;
Previous Topic: Installation: Oracle 9.2.0.1 on AIX 5.3.0.0
Next Topic: Need help in reading from flat tile in shell scripting
Goto Forum:
  


Current Time: Thu Mar 28 03:08:25 CDT 2024