RE: can't run sql script inside ksh script
Date: Mon, 7 Dec 2009 11:24:51 +0100
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.
>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
>2) Sqlplus .../..._at_db <<!