Command Window 'spool': capturing entered commands

Gary Wong

Member
How do I get the 'spool' command to capture not just the output of my commands, but also the entered commands?

See below for an example..
thanks in advance,
gary

------- in Command Window ---------

SQL> spool c:\temp\a.lst
Started spooling to c:\temp\a.lst

SQL> desc dual
Name Type Nullable Default Comments
----- ----------- -------- ------- --------
DUMMY VARCHAR2(1) Y

SQL> select * from dual;

DUMMY
-----
X

SQL> spool off
Stopped spooling to c:\temp\a.lst

------- in resulting file ---------

Name Type Nullable Default Comments
----- ----------- -------- ------- --------
DUMMY VARCHAR2(1) Y

DUMMY
-----
X

------- end ------
 
Thanks for the quick answer. I put it into my glogin.sql and now the 'spool' command in PLSQL/Dev's command window works as I expect it to..

thanks again,
gary
 
it seems "SET ECHO ON" causes problem with Command window:

Before putting "SET ECHO ON" in Login.sql.
copy/paste this into Command Dialog

Code:
SELECT *
  FROM emp t
 WHERE job = 'SALESMAN';
I get this - all is good:

Code:
SQL> SELECT *
  2    FROM emp t
  3   WHERE job = 'SALESMAN';

EMPNO ENAME        JOB         MGR HIREDATE          SAL      COMM DEPTNO
----- ------------ --------- ----- ----------- --------- --------- ------
 7499 hello        SALESMAN   7698 20-Feb-1981   1600.00    300.00     30
 7521 hello        SALESMAN   7698 22-Feb-1981   1250.00    500.00     30
 7654 hello        SALESMAN   7698 28-Sep-1981   1250.00   1400.00     30
 7844 hello        SALESMAN   7698 08-Sep-1981   1500.00      0.00     30
After putting in "SET ECHO ON" in login.sql....do the same copy/paste...this is what the Command dialog outputs:

Code:
SQL>  SELECT *
  SELECT *

   2     FROM emp t
    FROM emp t

   3   WHERE job = 'SALESMAN';
  WHERE job = 'SALESMAN';

 SELECT *
    FROM emp t
 WHERE job = 'SALESMAN'
Looks like a mess.... :(

1) Is this a known issue with my version ?
2) Is there a way to correct this ?
3) Is this still the case with current version ?
4) Unrelated question : Does my version support the "spool....append" command ?

thanks
 
This does indeed seem like a bug, even in the current version. We'll fix it. I have added support for "spool append" to the list of enhancement requests.
 
Back
Top