DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: using append command in spool file

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    86

    using append command in spool file

    how can i use 'append' clause in spool file to keep my existing spool file and add to it whenever i re-login

  2. #2
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: oracle-base.com
    My blog: oracle-base.com/blog

  3. #3
    Join Date
    Feb 2006
    Posts
    86
    hi tim
    its not working in that way also as iam using oracle 9i
    i write this in glogin.sql file:
    column l_date new_value l_date noprint
    select to_char(sysdate,'DDMONYYYY') l_date from dual;
    spool c:\sqllog\log_&&l_date append
    and when i login to my sql it gives following error:
    Illegal spool file name: "c:\sqllog\log_14FEB2006 append" (bad character: ' ')

    is there any other way. i don't want to overwrite the previous data in my spool file that was created very first time i logged to my SQL.

    thanx

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    no, cant do that, 9i doesnt support appending to a spool file

  5. #5
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    You could create a sequence and use that in the file name OR use sys_context('USERENV','SESSIONID') - either way every logon will have a unique file name. eg:

    select to_char(sysdate,'DDMONYYYY')||'_'||sys_context('USERENV','SESSIONID') l_date from dual;
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  6. #6
    Join Date
    Feb 2003
    Location
    Leeds, UK
    Posts
    367
    And yet another idea. If you're on UNIX create an alias in your .profile for sqlplus:

    Code:
    alias sqlplus='sqlplus /nolog 2>&1 | tee -a mysqlplus.log
    I believe this should work

Posting Permissions

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


Click Here to Expand Forum to Full Width