Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2004
    Posts
    3

    Unanswered: Spooling in same file without rewriting the old values

    Hello all,
    I want to execute a scheduled simple sql script wich spool some values into an text file.
    for example
    set linesize 100
    set pagesize 70
    set echo off
    set verify off
    set heading off
    set feedback off
    spool &1
    set heading off
    set colsep |
    select name, dept from emp where dept='cont';
    spool off
    print message
    prompt Renuntati cu <Enter> ...
    pause
    exit


    I want every time when the script run, the output values to be stored in the same file without rewriting tha old output values.
    Regards Dorin

  2. #2
    Join Date
    Sep 2004
    Location
    London, UK
    Posts
    565
    In 10g you can use the APPEND option of SPOOL.

  3. #3
    Join Date
    Dec 2004
    Posts
    3
    I use 8i.Is this option available in 8i?
    Thanks Dorin

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    no, he said in 10g. all versions below do not have this option.

    If you are on unix/linux then this is very easy to accomplish.
    spool the file then append spooled file to original file you want to append to.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  5. #5
    Join Date
    Dec 2004
    Posts
    3
    and another option exist or i am dead with this?

  6. #6
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    There is no 8i SQL Plus option obviously (otherwise they wouldn't have introduced APPEND in 10G )

    You will have to work around this: spool to an overwritable file, and then append that file to the main file using OS commands or a program of some kind.

  7. #7
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Quote Originally Posted by dorintop
    and another option exist or i am dead with this?
    Your could rewrite the application to use utl_file, which wold allow you to append. See

    http://download-west.oracle.com/docs...ile.htm#998101
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  8. #8
    Join Date
    Sep 2004
    Location
    London, UK
    Posts
    565
    You might be able to install the 10g client software. This is straightforward on the desktop, though I haven't tried on the server. How well the 10g client works with an 8i server I'm not sure though (you could try on the desktop first).

Posting Permissions

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