Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2012
    Posts
    13

    Unanswered: How to use spool in windows?

    Hi All,
    Please observe the following query

    SQL> spool dil.txt
    SQL> select name from v$datafile;

    NAME
    ------------------------------------------------------------------------------

    D:\APP\DNALLURI\DILPROD\SYSTEM01.DBF
    D:\APP\DNALLURI\DILPROD\SYSAUX01.DBF
    D:\APP\DNALLURI\DILPROD\UNDOTBS01.DBF
    D:\APP\DNALLURI\DILPROD\USERS01.DBF

    SQL> spool off;
    SQL> !cat dil.txt
    SP2-0734: unknown command beginning "!cat dil.t..." - rest of line ignored.
    SQL> @dil.txt
    SP2-0734: unknown command beginning "SQL> selec..." - rest of line ignored.
    SP2-0042: unknown command "NAME" - rest of line ignored.
    SP2-0734: unknown command beginning "D:\APP\DNA..." - rest of line ignored.
    SP2-0734: unknown command beginning "D:\APP\DNA..." - rest of line ignored.
    SP2-0734: unknown command beginning "D:\APP\DNA..." - rest of line ignored.
    SP2-0734: unknown command beginning "D:\APP\DNA..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    SP2-0734: unknown command beginning "SQL> spool..." - rest of line ignored.
    SQL> ./dil.txt
    SP2-0042: unknown command "./dil.txt" - rest of line ignored.

    Please let me know how can i execute the spool file in Windows?

    Thanks in Advance

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What do you mean by "execute the spool file"? There's nothing to "execute" here, it just lists database files.

    But, if you want to see spooled file's contents, then try with HOST or $:
    Code:
    SQL> spool dept.txt
    SQL> select * from dept;
    
        DEPTNO DNAME          LOC
    ---------- -------------- -------------
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    
    SQL> spool off;
    SQL>
    SQL> host type dept.txt
    SQL> select * from dept;
    
        DEPTNO DNAME          LOC
    ---------- -------------- -------------
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    
    SQL> spool off;
    
    SQL> $type dept.txt
    SQL> select * from dept;
    
        DEPTNO DNAME          LOC
    ---------- -------------- -------------
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    
    SQL> spool off;
    
    SQL>

  3. #3
    Join Date
    Jul 2012
    Posts
    9

    spool

    I THINK

    spool file creates a file of our work(records work) and we can open directly.
    If we use script file we get code, execute, save etc., in sql*plus environment.

  4. #4
    Join Date
    Jul 2012
    Posts
    9

    spool

    spool <path|filename>.<lst|log>;

    *******************
    YOUR STATEMENTS
    ********************

    spool off;

    (now check <path|filename> in your system)
    -----------------------------------------------------------------------
    script
    __________________________________________________ _____________

    ******************
    YOUR STATEMENT
    ******************
    save <path|filename>
    get <path|filename>
    @ <path|filename>
    run <path|filename>
    ed <path|filename>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •