Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Calling sqlplus or plsql code from ksh
capitaldog_at_hotmail.com (capitaldog_at_hotmail.com) wrote in message news:<cc72d8ab.0402191948.49c839c8_at_posting.google.com>...
> Can you guys show me some of the ways to run sql code from ksh scripts.
>
> Thanks,
> dog
Hi,
Hope the following example helps.
#!/usr/bin/ksh
sqlplus -s USER/PASS <<-EOF
set feed on echo on verify on
whenever sqlerror exit sql.sqlcode
DECLARE
Temp VARCHAR2(6);
BEGIN
SELECT 'Raj' INTO Temp FROM dual;
END;
/
exit
EOF
# END_OF_FILE
Have a nice day
Raj
Received on Fri Feb 20 2004 - 03:23:00 CST