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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

set echo on not working in sqlplus via unix shell

KK23Oct 12 2017 — edited Oct 13 2017

Hi All,

i have created the unix shell program, inside i have connecting sqlplus and calling the .sql file . if i run the shell program set echo on operation is not working and in my spool output it is showing table created. we need the entire script of the .sql file in spool output. Can you please adivse how can i rewrite or resolve.

Shell script:

Generate_sql ()

{

SQL=$1

sqlplus -s <<-EOF

${USERNAME}/${PWD}@${SID}

spool temp.log

@temp.sql

EOF

}

.sql file

SHOW USER;

SET SERVEROUTPUT ON;

SET DEFINE OFF;

SET ECHO ON;

SET TIMING ON;

CREATE TABLE TEMP_TABLE (ID NUMBER,NAME VARCHAR2(100) );

spool output:

Table created.

Elapsed: 00:00:00.17

Required output:

CREATE TABLE TEMP_TABLE (ID NUMBER,NAME VARCHAR2(100) );

Table created.

Elapsed: 00:00:00.17

This post has been answered by New Roots on Oct 13 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2017
Added on Oct 12 2017
4 comments
5,658 views