Skip to Main Content

Oracle Database Discussions

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!

How to get from Solaris shells script the resulting Oracle DB data from SQL command?

pstein-JavaNetOct 28 2016 — edited Nov 4 2016

Assume I wrote a simple SQL statement (SELECT ...FROM...WHERE....) for an existing Oracle DB and put it in a separate *.sql file on Solaris v11.

Now I want to connect from inside a shell script to the Oracle DB and pass this *.sql script for execution.

The resulting database rows should be retrieved into CSV file for later (script) processing.

From Windows batch script I could do this by entering a command similar to

sqlplus.exe username/password@database @blah.sql >output.log

Is there a similar DB client like sqlplus.exe on Solaris?

How else can I achieve such a processing?

Do I have to obey something special (e.g. to make result file human readable)?

Is there somewhere an example script for DB access?

Thank you

Peter

This post has been answered by EdStevens on Oct 29 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2016
Added on Oct 28 2016
10 comments
953 views