Home » Infrastructure » Unix » connecting to oracle from shell script
connecting to oracle from shell script [message #98471] Sun, 14 November 2004 14:32 Go to next message
KP
Messages: 4
Registered: March 2001
Junior Member
#UserTest.sh
User()
{
sqlplus /nolog <<EOF
conn / as sysdba
spool /tmp/check_User.out
start /oracle/home/check_User.sql;
spool off
exit
EOF
user=`cat /tmp/check_User.out`
echo $user
}

User

For this shell script i am getting the error
UserTest.sh: syntax error at line 3 : `<<' unmatched

Tell me what changes to do for connecting to oracle database from a korn shell script. Tell me if there is a way to connect to sqlplus -s (to database) it should work for both 8i & 9i.

Thanks !
Re: connecting to oracle from shell script [message #98472 is a reply to message #98471] Mon, 15 November 2004 07:07 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I'm pretty sure that the closing EOF needs to be in column #1 (no indenting), check that.

http://www.orafaq.com/forum/t/37286/0/

[Updated on: Fri, 18 February 2005 23:32]

Report message to a moderator

Previous Topic: search script
Next Topic: Oracle Integration with Microsoft Active Directory on Unix Platform
Goto Forum:
  


Current Time: Tue Nov 26 03:18:30 CST 2024