RE: can't run sql script inside ksh script

From: Alessandro Vercelli <alever_at_libero.it>
Date: Mon, 7 Dec 2009 11:24:51 +0100
Message-Id: <KUA29F$3774D7F91FCCC9DA2E38D8D3B21B8EA3_at_libero.it>



Maybe others already said, there are other ways of doing that:

cat <your_sql_script.sql> | sqlplus user/pwd_at_db

or, for simple sql instructions:

echo -e "column DUMMY format a5;\n select DUMMY from DUAL;" | sqlplus user/pwd_at_db

Maybe, the -e option for echo is available only on linux.

I'm not 100% sure, the sql script must contain the exit instruction in order to to return the control to the shell.

Alessandro

>You can either execute script from sql+ cmd line with _at_ or use ksh here-doc syntax. You're doing both at the same time. The later will over-ride and you will get nothing.
>
>1) sqlplus user/pwd_at_db @my-script
>Or
>2) Sqlplus .../..._at_db <<!
>_at_my-script
>exit
>!

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Dec 07 2009 - 04:24:51 CST

Original text of this message