2 Replies Latest reply: May 26, 2011 1:17 PM by 864533 RSS

    SQLPlus: echo input script to stdout... how?

    864533
      Hey Guys,

      I am executing a sqlplus script with the following:
      sqlplus /nolog < mysqplus.sql
      Where mysqlplus.sql contains:
      set echo on;
      connect userid/password@service_name

      select count(*) from mytable;
      exit;
      Which is resulting in the following echo'ed to stdout:
      SQL*Plus: Release 11.2.0.2.0 Production on Wed May 25 20:06:17 2011

      Copyright (c) 1982, 2010, Oracle. All rights reserved.

      SQL> SQL> Connected.
      SQL> SQL>
      COUNT(*)
      ----------
           2

      SQL> SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing option
      How do I get the executed sql echo'ed as well? In other words, I would like the sql:
      select count(*) from mytable;
      echo'ed to stdout just before it is executed. I thought the option:
      set echo on;
      would do the trick... but it didn't. Any help would be greatly appreciated.

      Edited by: user13385044 on May 25, 2011 8:12 PM