Spool file with sysdate

How create spool file with current date and time?
I want to create spool file like xyz_28062010.
Please, suggest.

like:
In SQL*Plus this is what you can do to get the current date/time as part of the spool file:
============================================================================================
SQL> column tm new_value file_time noprint
SQL> select to_char(sysdate, 'YYYYMMDD') tm from dual ;
1 row selected.
SQL> prompt &file_time
20020816
SQL> spool C:\Temp\logfile_id&file_time..log Reference: Creating a spool file with date/time appended to file name
Edited by: Gj on Jun 28, 2010 11:45 AM

Similar Messages

  • SPOOL FILE CALLED SYSDATE

    Hello, I'm trying to create a spool file with the name 'file01_concatenated_with sysdate'
    does some one tell me the sentence i have to use to printout the sysdate on the spool file?
    Thank you

    check this link:
    Re: updating a spool file name

  • Creating a spool file with date/time appended to file name

    In Oracle Sql*Plus, I want to spool out a file, with the date-time stamp as part of the file name. Any idea how to do this?
    Here's what I have right now:
    SQL>
    set serveroutput on size 200000;
    rem
    rem $OFSA is a UNIX alias so sql plus is talking to UNIX
    rem
    spool $OFSA/logs/OFSAP/common_coa_id.log;
    prompt 'Enter date in mmddyyyy format, without quotes';
    exec upd_common_coa_id_driver ('&date_mmddyyyy');
    spool off;
    As an example, I'd like to have a file with this name: common_coa_id083002.log
    Thanks.

    In SQL*Plus this is what you can do to get the current date/time as part of the spool file:
    ============================================================================================
    SQL> column tm new_value file_time noprint
    SQL> select to_char(sysdate, 'YYYYMMDD') tm from dual ;
    1 row selected.
    SQL> prompt &file_time
    20020816
    SQL> spool C:\Temp\logfile_id&file_time..log
    . /* put your code here */
    . /* it will go to a file called C:\Temp\logfile_id20020816.log */
    SQL> spool off
    SQL>

  • Creation of Spool File with Triggers

    Hi,
    I have created an OnUpdate trigger using the Essbase Console. I am using a calculation script to change the value of an account that is being used in the trigger. The trigger doesnot craete a spool file. Can anyone help me with it.

    Are you sure that the data value that should change did change?
    Here I am plugging Glenn's presentation twice in like five minutes. Check out this (unrelated) thread -- it explains how to get to his Kaleidoscope presentation.
    How to use a substitution variable in a load rule?
    FWIW, this part of the presentation was really good (it was all good, but I particularly enjoyed this bit).
    Regards,
    Cameron Lackpour

  • Spool file with just the data

    Hi,
    I have a sql query that I'm spooling to a file. I have set echo off, heading off, feedback off, verify off. The spool file is exactly what I want except for the SQL prompt and the actual query. It looks like this:
    SQL> "select statement;"
    data data
    data data
    data data
    data data
    SQL>
    What parameter do I set so that the
    SQL> "select statement"
    doesn't appear in the spooled file at the top, and
    SQL>
    doesn't appear at the bottom?
    I need data only.
    Thanks
    -Bob

    Hi,
    Try running your SQL from within a script instead of executing it directly from SQL prompt.
    i.e. Script a.sql
    set head off;
    set echo off;
    set feed off;
    set verify off;
    spool c:\1;
    select col1, col2
    from table;
    Spool Off;
    set head on;
    set echo on;
    set feed on;
    set verify on;
    In SQL promot,
    SQL> @a
    This should give you the output without SQL commands etc.
    Shailender Mehta

  • How to spool file with a timestamp/seq_number in the file name

    Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..

    vxwo0owxv wrote:
    Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..
    >Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..
    set termout off
    col dt new_value dt
    select to_char(sysdate,'YYYYMMDDHH24MISS') dt from dual;
    set termout on
    spool file_&dt
    -- place your SQL here
    spool off
    Handle:     vxwo0owxv
    Status Level:     Newbie
    Registered:     Mar 14, 2011
    Total Posts:     142
    Total Questions:     79 (59 unresolved)
    WHY am I NOT surprised?
    Edited by: sb92075 on Apr 24, 2012 4:37 PM

  • Spool file with comma including quotes

    Hi All,
    I am getting the csv file however location commas are treated as another column in file. I am expecting based on the below SQL only two columns and all the data should be in two columns though we have comma value in location string.
    CREATE TABLE DEPT ( DEPTNO NUMBER,LOCATION VARCHAR2(255));
    INSERT INTO DEPT (DEPTNO,LOCATION) VALUES(100, 'CHICAGO,NEWYORK');
    INSERT INTO DEPT (DEPTNO,LOCATION) VALUES(200, 'ATLANTA,NEWYORK');
    INSERT INTO DEPT (DEPTNO,LOCATION) VALUES(300'OMHA,NEWYORK');
    INSERT INTO DEPT (DEPTNO,LOCATION) VALUES(100, 'NEWJERSEY,NEWYORK');
    COMMIT;
    sql file :
    set pagesize 10000
    set feedback off
    set heading off
    set echo off
    spool r:\dept.csv
    select to_char(deptno)||','||rtrim(location)
      from dept;
    spool off
    set echo on
    set heading on
    set feedback onEdited by: user1758353 on Dec 6, 2011 7:47 AM
    Edited by: user1758353 on Dec 6, 2011 7:47 AM
    Edited by: user1758353 on Dec 6, 2011 7:48 AM

    try to wrap your column location with a double quotes.
    e.g.
    select to_char(deptno)||','||'"'||rtrim(location)||'"'
      from dept;when you opened your csv file on excel it considers the strings enclosed on a double quotes as one column.

  • Saving spool request with multiple Adobe PDF files to local directory

    Hi,
    I have a spool file with multiple Adobe PDF files in it.  You can only save the spool content to local directory by opening and save each PDF files.  Does anyone know whether there is a way to combine all the PDF files within a spool into one big PDF file?
    Chuin

    Are you using any plugins, like PDFlyer?

  • Error SP2-0333: Illegal Spool File Name: (bad character: ' ')

    Below is my spool file logic just to test outputting to a spool file with a date in the spool file. The date part works fine. I can see the date coming out in the error message. It doesn't like the spaces, but I am not in control of the folder names. Any ideas? I have tried putting single and double quotes around it to no avail. I also tried using the concatenation operator || to separate the path from the filename and that didn't work, either.
    col sdate new_value sysdt
    select to_char(sysdate,'YYYY-MM-DD') sdate from dual;
    SPOOL \\Nsgnvl_files\rco\Linecost Audit\General NA Info\CLLI_Code_Discrepancy_Reports\&sysdt.SendToLCAnotInRepository.txt
    SELECT TO_CHAR(sysdate) from dual;
    spool off

    Example :
    SQL> set escape |
    SQL> spool "c:\test| dir\foo"
    SQL> select sysdate from dual;
    SYSDATE
    2007-09-27 16:31:30
    SQL> spool off
    SQL> exit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Prod
    ction
    C:\>cd test dir
    C:\test dir>type foo.lst
    SQL> select sysdate from dual;
    SYSDATE
    2007-09-27 16:31:30
    SQL> spool off
    C:\test dir>Message was edited by:
    Paul M.
    but I am not in control of the folder namesSorry, I didn't read carefully.....

  • How to increase spool file width?

    Hi,
    I've a spool file with lot of columns. When I display it (in graphical format) through SM37, the columns appear in two rows and thus it becomes difficult to understand the data.
    How can I increase the width so that all columns appear in a single row?
    Regards,
    Vikrant.

    Hi,
    I suppose that the report you executed to have this list is a cutom report.
    If it's the case you will have to add the following extra statement (in bold) in your report to define the number of columns during output
    REPORT ZREPNAME LINE-SIZE 132.
    ... LINE-SIZE col
    Creates a report with col columns per line.
    If the LINE-SIZE specification is missing, the line length corresponds to the current screen width. The system field SY-LINSZ contains the current line size for generating lists. The maximum width of a list is 1023 characters. You should keep lists to the minimum possible size to improve useability and performance (recommendation: LINE-SIZE < 132). For very wide lists (LINE-SIZE > 255), you should consult the notes for using LINE-SIZE
    Hope that the following info will help you
    Regards

  • Output different with the spool file

    Hi friends,
    I have using this Tcode : S_ALR_87012301 to print GL account balances.
    once executed, the system display correct information.
    but once printed, in spool file, instead of showing the name of the company , the system displayed the environment e.g Production. If we try to print in DEV, the system will display Development.
    Your advice is highly appreciated.

    Celtic Mom
    Welcome to the Apple user to user discussion forums
    While I was organizing my photos, I realized there are about 30 or so photos that have the same exact file name as another photo. Example: There are two IMG_1243.jpg, but they are different pictures. They were taken at different times, even different years. I have used more than one camera to import photos. I have changed the name of one of the photos in the Title area in the information section of iPhoto. When I try to put the newly named photo into a folder that has the other IMG_1243, I get a message that says" An older item named "IMG_1243" already exists. Do you want to replace it with the newer one you are moving?"
    I want to have both IMG_1243.jpg photos in the same folder. How can I do this? Also, I have a few thousand pictures, so how can I tell exactly how many photos have the same file name as another photo?
    It sounds like you are using the finder inside the iPhoto library - do not do that - you will corrupt your library and lose the edits, keywords, etc that you have
    iPhoto does not care about duplicate file names - it handles it fine
    changing the title of a photo does not affect the file name - although when you export the photo you can use the title for the file name as an option
    What are you doing and what do you want to accomplish?
    Remember do not ever make any changes in the iPhoto library using the finder or any other program
    LN

  • SFTP MGET of large files fails - connection closed - problem with spool file

    I have a new SFTP job to get files from an FTP Server.  The files are large (80mg, 150mg).  I can get smaller files from the ftp site with no issue, but when attempting the larger files the job completes abnormally after 2 min 1 sec. each time.  I can see the file is created on our local file system with 0 bytes, then when the FTP job fails, the 0 byte file is deleted.
    Is there a limit to how large an ftp file can be in Tidal?  How long an ftp job can run?
    The error in the job audit is Problem with spool file for job XXXX_SFTPGet and an exit code of 127 (whatever that is).
    In the log, the error is that the connection was closed.  I have checked with the ftp host and their logs show that we are disconnecting unexpectedly also.
    Below is an excerpt from the log
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.055 : Send : Name=SSH_FXP_STAT,Type=17,RequestID=12
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.055 : Transmit 44 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.055 : Remote window size decreased to 130808
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.071 : RepeatCallback received 84 bytes
    DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.071 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
    DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.071 : Received message (type=105,len=37)
    DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.071 : AddMessage(12) - added to store
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Reply : Name=SSH_FXP_ATTRS,Type=105,RequestID=12
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Send : Name=SSH_FXP_OPEN,Type=3,RequestID=13
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.071 : Transmit 56 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.071 : Remote window size decreased to 130752
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.087 : RepeatCallback received 52 bytes
    DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.087 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
    DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.087 : Received message (type=102,len=10)
    DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.087 : AddMessage(13) - added to store
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Reply : Name=SSH_FXP_HANDLE,Type=102,RequestID=13
    DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Send : Name=SSH_FXP_READ,Type=5,RequestID=14
    DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.087 : Transmit 26 bytes
    DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.087 : Remote window size decreased to 130726
    DEBUG [PlainSocket] 6 Feb 2015 14:17:33.118 : RepeatCallback received 0 bytes
    DEBUG [SFTPChannelReceiver] 6 Feb 2015 14:17:33.118 : Connection closed:  (code=0)
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : Disconnected unexpectedly ( [errorcode=0])
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : EnterpriseDT.Net.Ftp.Ssh.SFTPException:  [errorcode=0]
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 :    at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.CheckState()
    ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 :    at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.GetMessage(Int32 requestId)

    I believe there is a limitation on FTP and what you are seeing is a timeout built into the 3rd party application that tidal uses (I feel like it was hardcoded and it would be a big deal to change but this was before Cisco purchased tidal)  there may have been a tagent.ini setting that tweaks that but I can't find any details.
    We wound up purchasing our own FTP software (ipswitch MOVEit Central & DMZ) because we also had the need to host as well as Get/Put to other FTP sites. It now does all our FTP and internal file delivery activity (we use it's api and call from tidal if we need to trigger inside a workflow)

  • Problem with spool file

    I have a written a hot backup script and I am having the following problem.
    In my script I do:
    dbms_output.put_line('alter system switch logfile;');
    dbms_output.put_line('archive log all;');
    dbms_output.put_line('!cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup');
    dbms_output.put_line('!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf');
    I spool the above and in the spool file it shows up as
    alter system switch logfile;
    archive log all;
    !cp /oracle/u01/oradata/design/arch/*.dbf
    /oracle/u11/oradata/design/recovery/archive_bkup
    !compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf
    alter database backup controlfile to trace;
    !cp /oracle/u01/oradata/design/arch/*.dbf
    /oracle/u11/oradata/design/recovery/archive_bkup
    This command fails as it shows up as 2 lines. How can I get in one line.
    Thanks.

    The reason that is happening is because your LINESIZE is set too low for this (probably 80).
    what you need to do is, do a SET LINESIZE 132 (or something larger, depending upon how big the
    entire line can be - up to 255 - limit of DBMS_OUTPUT.PUT_LINE) and then run the PL/SQL
    statements:
    SQL> set serveroutput on
    SQL> set linesize 132
    SQL> begin
      2  dbms_output.put_line('alter system switch logfile;');
      3  dbms_output.put_line('archive log all;');
      4  dbms_output.put_line('!cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup');
      5  dbms_output.put_line('!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf');
      6
      7  end ;
      8  /
    alter system switch logfile;
    archive log all;
    !cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup
    !compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf
    PL/SQL procedure successfully completed.
    SQL>

  • How to get the number of rows written to the header of the spool file.

    Hi
    I need to create a header line for the spool file .
    the header line should include fixed length values .
    The header should include the number of records found in the table with a maximum begin date (begin_date is the column of the table)
    To get the header in the spool file , i wrote a select query has :-
    --SPOOL 'C:\Documents and Settings\abc\Desktop\output.TXT'
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school
    group by sysdate;
    SPOOL OFF
    which gets me all the rows in the table , but i only want the rows with the latest school_begin_date .
    how can i achieve that ...
    I know that a subquery should be written in the from clause to get the number of rows found with a maximum school_begin_date.
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school where
    select rownum from dad.school
    where school_begin_date = max(school_begin_date) ;
    the error i get is
    ORA-00934: group function is not allowed here
    I NEED HELP ..IN GETTING THE ROWNUM JUST FOR THE LATEST BEGIN_DATE ?
    PLS HELP ME IN WRITING THE QUERY .
    THANKS IN ADVANCE .

    Try this:
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000')||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) || rpad(' ',76,' ')
      from dad.school
    where school_begin_date = (select max(school_begin_date)
                                  from dad.school);

  • Dunning letters as individual/separate spool file

    Hi All,
    I've found that dunning run by F150 in my company sometimes gives an output results as separate spool file for every customer what is unexpected.  Usually we get one common spool with multiple pages. I would appreciate it somebody can give me the clue what is the reason. I couldn't find any system and transaction settings... Thanks in advance.
    Greg

    Hi,
    see the link below :
    http://web.mit.edu/CAO/www/SB2002/AR/F150.htm
    SKS

Maybe you are looking for

  • Error Message "not a valid Windows CE application?"

    Hi, I build an executable using PDA module and try to open it up on Pocket PC, but it says "FILENAME is not a valid Windows CE application" every time.  Can any one give me a pointer or two? Do I have to install a thing or two onto the Pocket PC syst

  • How to use server time in  Timer Class

    Hai, I have develped an application(stand alone) using swings. the exe runs in all the systems in my company. requirement is --> application has to be closed at 11.59 P.M everyday. i did this task using Timer class. Timer class takes the system time

  • Set Cursor in MPP

    Hi, I have 6 fields on my MPP screen. Based on the validations, I need to set the cursor to the appropriate field that has an invalid entry. As per the functionality, I show the error screen and when I come back, the cursor should be set to the field

  • How do you change the project calender

    How do you change the project calender without changing the individual existing activities?

  • Dynamic text not showing up under a mask

    Hi All, So like many people, I've discovered the joy that you cannot display dynamic text boxes if they are masked. After browsing the internet I found a few things to try, first embedding the font, which I have done, and that didn't work. The other