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!

shell script/sqlplus write sql statement to output

user7315043Apr 18 2014 — edited Apr 22 2014

${SQLPLUS} -S ${CONNECT_STR} <<EOF >>${LOG_FILE}

select sysdate from dual;

exit

EOF

At the moment only the query result will be written to the log file. Is it possible that the sql statement will also be shown in the log file? One of my ideas is to prompt the statement additionally. Another way would be that the statement is in a sql script and set echo on. Or is there another simple way?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2014
Added on Apr 18 2014
9 comments
28,307 views