Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: calling sql from korn shell script
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
![]() |
![]() |