how to Spool results from SQL plus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mario Horvat

    how to Spool results from SQL plus

    I want to spool results from sql+ query to txt file.
    txt file should have name like YYMMDD_anything .txt, where YYMMDD is actual
    date.

    Can somebody tell me how to write this?

    Thanks in advance.


  • Andy Triggs

    #2
    Re: how to Spool results from SQL plus

    You can do it like this:

    VAR SPOOLFILENAME VARCHAR2(30)
    COLUMN SPOOLFILENAME NEW_VALUE SPOOLFILENAME
    SELECT to_char(sysdate , 'YYMMDD') || '_anything.txt' AS SPOOLFILENAME FROM DUAL;

    SPOOLFILENAME
    -------------------
    040407_anything .txt

    SPOOL &SPOOLFILENA ME
    ....

    "Mario Horvat" <mario.horvat@v z.htnet.hrwrote in message news:<c512v5$in v$1@sunce.iskon .hr>...
    I want to spool results from sql+ query to txt file.
    txt file should have name like YYMMDD_anything .txt, where YYMMDD is actual
    date.
    >
    Can somebody tell me how to write this?
    >
    Thanks in advance.

    Comment

    Working...