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

Home -> Community -> Usenet -> c.d.o.misc -> Re: calling sql from korn shell script

Re: calling sql from korn shell script

From: pawan_test <sridhara007_at_gmail.com>
Date: 3 Oct 2005 20:11:48 -0700
Message-ID: <1128395508.840792.276750@z14g2000cwz.googlegroups.com>


hello Hans.,

actually i have a code written. but for some reason it is not workin. i dunno why./

netuser is UID; netpass is password and netconnect is the string

here it is:

!# /usr/bin/ksh

logfile=/usr/dumps/errors.log

sqlplus -s netuser/netpass_at_netconnect << SQLEND> errors.log select * from emp;
SQLEND if [ $? -eq 0 ]
then

        echo "\n SQL completed successfully at `date`" else

        echo "!!! FAILED!!!"
        echo "Details can be found in errors.log File"
fi

CAN YOU PLS TELL ME WHERE IS THE error in the above code is.,

thanks
pawan
HansF wrote:
> You mean something like
>
> oracle_at_mini:~> cat x
> sqlplus <<EOF
> scott/tiger_at_orcl
> select * from dual;
> rem exit
> EOF
>
>
>
> --
> Hans Forbrich
> Canada-wide Oracle training and consulting
> mailto: Fuzzy.GreyBeard_at_gmail.com
> *** I no longer assist with top-posted newsgroup queries ***
Received on Mon Oct 03 2005 - 22:11:48 CDT

Original text of this message

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