Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using select statement from sql plus with a shell script

411635Sep 9 2004 — edited Sep 10 2004
Hiya,

Using a shell script I am trying to access the oracle database using below

. /export/home/oracle/.profile
sqlplus /nolog << EOF
connect usrid/passwd@DatabaseInstance

how do I store the result of a select statement into a variable which can be accessed from the shell script . For eg. suppose I was to do

select count(1) from sample table

and get a value, how do I let the shell script know about this value.

I have some logic residing on the value returned.

Thanks in advance.


Cheers
XXX
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2004
Added on Sep 9 2004
7 comments
2,712 views