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