Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling sql statement from Unix scripts

Status
Not open for further replies.

jayjaybigs

IS-IT--Management
Jan 12, 2005
191
CA
Hello all,

I was just wondering if anyone has a scripts that will let you connect to database from the Unix box, execute your select statemetn, spool the result of the select and exit oracle server.

Tahnks
 
Hello All,

I am trying to call my simple sql statement from within either unix or perl script. I know this is simple enough.

Here is my effort:

#!/bin/sh

sqlplus RPB/lowrider

@check.sql

exit

However, I am not having any luck. Also, the script is not exiting sqlplus back to unix box
 
Just to know, have you read the FAQ I suggested you ?
 
Here is the solution I came up with:
#!/bin/sh
sqlplus /nolog <<EOF
connect RPB/lowrider
@check.sql
exit
EOF

Your FAQ dealt with different subject. I just wanted a simple solution!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top