UNIX and Oracle (SQL*Plus)

UNIX and Oracle (SQL*Plus)

Post by Gresford A. Thoma » Sat, 10 Jul 1999 04:00:00



I am attempting to create a Korn shell script which will run a
SQL/SQL*Plus program within it.  Currently I have imbedded the following
command in my script to execute SQL*Plus:  sqlplus / <<!

When this command is executed, SQL*Plus is entered under UNIX but
instead of running the entire SQL program, it shells out to the UNIX
Korn Shell prompt ($) and ceases execution.

Does anyone know what I need to do with the above command to allow
SQL*Plus to properly run the entire SQL program?

Any help would be greatly appreciated.

--
Gresford A. Thomas

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

UNIX and Oracle (SQL*Plus)

Post by Gresford A. Thoma » Sat, 10 Jul 1999 04:00:00


I am attempting to create a Korn shell script which will run a
SQL/SQL*Plus program within it.  Currently I have imbedded the following
command in my script to execute SQL*Plus:  sqlplus / <<!

When this command is executed, SQL*Plus is entered under UNIX but
instead of running the entire SQL program, it shells out to the UNIX
Korn Shell prompt ($) and ceases execution.

Does anyone know what I need to do with the above command to allow
SQL*Plus to properly run the entire SQL program?

Any help would be greatly appreciated.

--
Gresford A. Thomas

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

UNIX and Oracle (SQL*Plus)

Post by Leroy Jand » Sat, 10 Jul 1999 04:00:00


Your probably not being able to log on.

Add     "1>log.one 2>log.two"   at the end of your command to see what is
happening.


> I am attempting to create a Korn shell script which will run a
> SQL/SQL*Plus program within it.  Currently I have imbedded the following
> command in my script to execute SQL*Plus:  sqlplus / <<!

> When this command is executed, SQL*Plus is entered under UNIX but
> instead of running the entire SQL program, it shells out to the UNIX
> Korn Shell prompt ($) and ceases execution.

> Does anyone know what I need to do with the above command to allow
> SQL*Plus to properly run the entire SQL program?

> Any help would be greatly appreciated.

> --
> Gresford A. Thomas

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

 
 
 

UNIX and Oracle (SQL*Plus)

Post by Eric Amic » Sat, 10 Jul 1999 04:00:00



Quote:> I am attempting to create a Korn shell script which will run a
> SQL/SQL*Plus program within it.  Currently I have imbedded the following
> command in my script to execute SQL*Plus:  sqlplus / <<!
> When this command is executed, SQL*Plus is entered under UNIX but
> instead of running the entire SQL program, it shells out to the UNIX
> Korn Shell prompt ($) and ceases execution.

Try using something other than "!" as the here document delimiter; I had
no trouble when I used EOF instead.

--
Eric Amick
Columbia, MD

 
 
 

UNIX and Oracle (SQL*Plus)

Post by Kurtis D. Rade » Sun, 11 Jul 1999 04:00:00



> I am attempting to create a Korn shell script which will run a
> SQL/SQL*Plus program within it.  Currently I have imbedded the following
> command in my script to execute SQL*Plus:  sqlplus / <<!

> When this command is executed, SQL*Plus is entered under UNIX but
> instead of running the entire SQL program, it shells out to the UNIX
> Korn Shell prompt ($) and ceases execution.

> Does anyone know what I need to do with the above command to allow
> SQL*Plus to properly run the entire SQL program?

From the ksh man page (on DYNIX/ptx):

     <<[-]word     The shell input is read up to a line that is
                   the same as word, or to an end-of-file.

If I were to hazard a guess it would be that the shell on your system is
not treating the exclamation mark as a "word" and is therefore passing
it through to the SQL*Plus process as part of the here document. Within
SQL*Plus an exclamation mark at the start of a line runs a command via
the shell (e.g., "!ls"). If nothing follows the exclamation mark you get
an interactive shell. Try using something like "EOT" as your here
document delimiter.

--

Sequent Computer Systems                     voice: +1 503-578-3714
15450 SW Koll Pkwy, MS RHE2-501              http://www.sequent.com
Beaverton, OR 97006-6063