Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Calling sqlplus or plsql code from ksh

Re: Calling sqlplus or plsql code from ksh

From: <m_raj_mohan_at_yahoo.com>
Date: 20 Feb 2004 01:23:00 -0800
Message-ID: <3e5dad90.0402200123.78e0b46f@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US