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>

Similar Messages

  • Idoc- File with date+time stamp, getting overwritten

    Hi,
    I have a scenario where in am writing Idocs from R3 to a Txt File in 3rd party system.
    For an instance upon running a Tx, am generating 3 idocs. I need all these 3 idocs to be written to a single file. Hence for the file naming i have used "CREDAT_CRETIM.txt" from EDI_DC40(all idocs carry same date+time).
    I have configured the file mode as Create -> using Temporary fileschema of "Ord.xfr". I need this for locking before FTP to the 3rd party system.
    If i check the OVER WRITE EXISTING FILE checkbox, i get only the last idoc written to the file(overwriting previous 2 idocs).
    If i Uncheck the OVER WRITE EXISTING FILE checkbox, i get only the first idoc written to the file(other 2 idocs are not written) they are shown successful in MONI.

    hi BRamchan,
    >>>><i>If i Uncheck the OVER WRITE EXISTING FILE checkbox, i get only the first idoc written to the file(other 2 idocs are not written) they are shown successful in MONI.</i>
    If you can see in moni successfully process, look in the RWB communication channel monitoring of the receiving channel, there you might find error.
    regards
    Ramesh P

  • Posting a File with Date Time using FTP in a BPM scenario

    Hi All,
      I have got a following requirement within the BPM ::-
    Step 1: We receive a file from an external system using FTPS with File Content Conversion Mode. The file is a comma separated file.
    Step 2 : We need to write the same file without any changes in data elements to another File System. The file to be written will be comma separated.
    Step 3 : The data will be mapped to an RFC and there will be a RFC Call to the ECC system.
    Step 4 : On successful call to RFC, the file will be dumped into the SAP File system also.
    The issue here is in Step 2. The additional requirement for Step 2 is to name the file with the following convention -
    ABCDEF_<Date in MMDDYYYY>_<Time in HHMMSS>_<Time in ms>_data.txt
    Can you help me on how to configure this from within the BPM ? I have seen blogs and replies in forum on using UDF's for the same. I am not sure on how to do this in BPM.
    Please help !!!
    Thanks,
    Amit

    Hi,
    I dont think you required BPM in this case,you can achieve this requirement using Multi mapping.
    3 Receive comunication channels
    1)to send file to receive File directory9Content conversion required)
    2)RFC Receiver Communication channel to make a cal to SAP ECC to send RFC..
    3)One more File communication channel to send data to SAP File System.
    refer below blog.
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    Regarding r file name use dynam ic configuration UDF or ASMA to chnage file name format to your desired format,if you decided to use UDF then map root nod of receiver file structure in multimapping.
    Regards,
    Raj

  • Our version of ID saves all files with the time/date of December 31, 1999.  How do we fix this?

    Our version of ID saves all files with the time/date of December 31, 1999.  How do we fix this?

    That's interesting. The file date should match the system date. What's the system date? What version of InDesign? What operating system?

  • How do I get the last changed date & time of a file in app server?

    Hi Experts,
    How do I get the last changed date & time of a file in app server?
    Thanks!
    - Anthony -

    Hi,
    that's what I use...
      CALL 'C_DIR_READ_FINISH'.             " just to be sure
      CALL 'C_DIR_READ_START' ID 'DIR' FIELD p_path.
      IF sy-subrc <> 0.
        EXIT. "Error
      ENDIF.
      DO.
        CLEAR l_srvfil.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD l_srvfil-type
          ID 'NAME'   FIELD l_srvfil-file
          ID 'LEN'    FIELD l_srvfil-size
          ID 'OWNER'  FIELD l_srvfil-owner
          ID 'MTIME'  FIELD l_mtime
          ID 'MODE'   FIELD l_srvfil-attri.
    *    l_srvfil-dir = p_path .
        IF sy-subrc = 1.
          EXIT.
        ENDIF." sy-subrc <> 0.
        PERFORM p_to_date_time_tz
          USING    l_mtime
          CHANGING l_srvfil-mod_time
                   l_srvfil-mod_date.
        TRANSLATE l_srvfil-type TO UPPER CASE.               "#EC TRANSLANG
        PERFORM translate_attribute CHANGING l_srvfil-attri.
        CHECK:
          NOT l_srvfil-file = '.',
          l_srvfil-type = 'D' OR
          l_srvfil-type = 'F' .
        APPEND l_srvfil TO lt_srvfil.
      ENDDO.
      CHECK NOT lt_srvfil IS INITIAL.
      pt_srvfil = lt_srvfil.
    FORM p_to_date_time_tz  USING    p_ptime  TYPE p
                            CHANGING p_time   TYPE syuzeit
                                     p_date   TYPE sydatum.
      DATA:
        l_abaptstamp TYPE timestamp,
        l_time       TYPE int4,
        l_opcode     TYPE x VALUE 3,
        l_abstamp    TYPE abstamp.
      l_time = p_ptime.
      CALL 'RstrDateConv'
        ID 'OPCODE' FIELD l_opcode
        ID 'TIMESTAMP' FIELD l_time
        ID 'ABAPSTAMP' FIELD l_abstamp.
      l_abaptstamp = l_abstamp.
      CONVERT TIME STAMP l_abaptstamp TIME ZONE sy-zonlo INTO DATE p_date
          TIME p_time.
    ENDFORM.                    " p_to_date_time_tz
    Regards,
    Clemens

  • Saving a file with data?

    HI, I am wanting to save a file with data, can some one point me in the right direction to a tut or some thing. Thanks.
    OR
    if they could be so kind as to code a simple thing that saves a file (txt) with a word. This would make my day,
    Thansk and all the best Jonathan :o).

    I have sorted what I was wanting to do. there was some code missing from the coding as well as the import function.
    No you don't have to be 'god' but if some one just handed you a russian/english dictionary you would still have a difficult time making a sentance or even a DVD with every thing there is to know speaking gaelic.
    You have to learn more than just the syntax. sorry I'm not the best person in the world for understanding docs etc, but we all have our good points, ask me any thing else on computers and networks I'll give a plain english answer, wood chips and all.
    This is all meant in a good tone, there is the problem with txt that it tend to have a dull sound, so cheer up and smile. I know I am.
    :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o)
    :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o) :o)

  • With 10.7.2 update iCal does not allow you to set "Reminders" by draging events from "All Day Events" into "Reminders" is there another way to do this instead of having to type out the entire reminder with date, time, and type?

    With 10.7.2 update iCal does not allow you to set "Reminders" by draging events from "All Day Events" into "Reminders" is there another way to do this instead of having to type out the entire reminder with date, time, and type?
    With Lion 10.7.1. you where able to drag events from "All Day Events" into the "Reminders" bar to create upcoming reminders.

    Exactly the same question I was about to post!
    Great being able to sync reminders (well overdue) however if I have to re-type a calener envent into reminders it's a waste of time!! 
    Come on Apple!!
    Just need an option for the calender event to add to reminder or the old drag to add to reminder functionality back, Please???

  • How to Run Export and Make Dump and Log File with Dates on NT

    Hi Gurus,
    set ORACLE_SID=ORCL
    set ORACLE_HOME=D:\ORACLE\ora92
    for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do
    set fdate=%%a%%b%%c
    exp userid=userid/password@connectstring
    file=exp%fdate%.dmp log=exp%fdate%.log full=y
    I am using above script for export and make dump file with dates, but when i am excuting this script with Schedule task i am getting error.
    C:\Documents and Settings\krishna>for /f "tokens=2,3,4 delims=/ " %%a in ('date
    /t') do
    %%a was unexpected at this time.
    Help is highly appriciated.
    Thanks & Regards
    praveen

    HOST('EXP80 MRPAY/MRPAYS FILE=D:\BACKUP\MRPAY'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=MRPAY CONSISTENT=Y');
    HOST('EXP80 SECSYS/SECSYS FILE=D:\BACKUP\SECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SECSYS CONSISTENT=Y');
    HOST('EXP80 SICPA/SICPA FILE=D:\BACKUP\SICPA'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPA CONSISTENT=Y');
    HOST('EXP80 SICPAINVSYS/SICPAINVSYS FILE=D:\BACKUP\SICPAINVSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAINVSYS CONSISTENT=Y');
    HOST('EXP80 SICPAGLSYS/SICPAGLSYS FILE=D:\BACKUP\SICPAGLSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAGLSYS CONSISTENT=Y');
    HOST('EXP80 SICPAPURHSYS/SICPAPURHSYS FILE=D:\BACKUP\SICPAPURHSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAPURHSYS CONSISTENT=Y');
    HOST('EXP80 SICPARECSYS/SICPARECSYS FILE=D:\BACKUP\SICPARECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPARECSYS CONSISTENT=Y');
    HOST('EXP80 SICPASECSYS/SICPASECSYS FILE=D:\BACKUP\SICPASECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPASECSYS CONSISTENT=Y');
    HOST('EXP80 FASYS/FASYS FILE=D:\BACKUP\FASYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=FASYS CONSISTENT=Y');
    HOST('EXP80 ATTSYS/ATTSYS FILE=D:\BACKUP\ATTSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTSYS CONSISTENT=Y');
    HOST('EXP80 ATTENDANCESYSTEM/ATTENDANCESYSTEM FILE=D:\BACKUP\ATTENDANCESYSTEM'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTENDANCESYSTEM CONSISTENT=Y');
    Arshad

  • Need to rescue Garage Band Files with Data Rescue II - what kind of files?

    Hi all -
    After a particularly gruesome computer crash, I am trying to reconstruct my lost files using Data Rescue II..... This program goes into the damaged hard drive and downloads all intact files it can find, but it is NOT able to label everything correctly. All it can do is divide things into folders - Audio files, document files, images, mail, misc., and movies. And within these folders are other folders - for instance, in the "Audio" rescued folder, there are hundreds of AIFF files, AIFF1 files, AIFF2, MP3, WAV, m4a, and m4p files.
    My question is: can someone please tell me what the heck a Garage Band project file is? That would save me a lot of time in digging through all this material trying to find one....
    (Don't get me wrong... I'm grateful to have stuff to dig through! I just hope my Garage Band files are intact and recoverable.)
    Has anyone had success saving Garage Band files with Data Rescue II?
    Thanks in advance.

    Aaaagh!
    I spoke too soon. Yes,I did indeed find the file that contained all the files I needed to retrieve (using Disk Rescue II). When my 6-hour download of the 78 GB folder finished, I check the files again, and they weren't located in the orphaned section, but in the Hard Drive section under the normal directory, in a folder called .Trashes - within that there was another folder called "501", which contained all the Garageband files I needed to retrieve. However, when I tried to open the downloaded "rescued" files, they were inside a folder called "Macintosh HD", which could not be opened, and I got a message that said "Could not be opened because you do not have sufficient access privileges." Not only that, but even after 6 hours of (apparently) downloading the 78 GB folder, my hard drive, which had close to 83 GB of free space, said STILL had almost that same amount.
    So did it download anything or not? What was it doing all those 6 hours? I have a file that I can't open, but apparently it's going to be empty anyway.
    Here's the full story, for anyone with the patience to listen and offer advice. It looks like now I'm looking for a way to 1) get the permissions to open the .trashes file so that I can download everything, or 2) figure out a way to get Disk Rescue II to open the files and download them regardless of the permissions.
    Full Story -
    I am pretty sure that my computer crash was caused by working with the newest version of Garageband 08. Ever since buying it and loading it, my computer has been acting funny whenever I use the Garage Band program - I could only record about one in three attempts since the computer kept freezing as soon as I finished recording a line. I would have to use force restart to get going again.
    The day the computer crashed, I was working on a Garage Band project, which kept crashing, and I was also using Finale, Microsoft Word, and iTunes -- all of which are my normal procedure and I'd never had any problems with anything before loading the new Garage Band 08. (See my posts on other discussion topics for more details). After the last freeze, the computer crashed totally and could not be restarted - it would get to the gray screen with the spinning gear and just sit there while the fans ramped up to overload.
    I used Disk Warrior to rescue whatever files I could onto an external hard drive, and I started to download all the Garage Band files. However, the "estimated time to completion" said over 6 hours , so I stopped the download after a minute or so and went on to rescue all the other files that were smaller in size and easier to download - I figured I'd set Disk Warrior to download the whole 78 GB set of Garage Band files overnight while I slept. But....when I went back to begin the download again, I noticed that the directory of Garage Band files went only to the letter "C" instead of all the way to "Z" like my original files had done during that earlier attempt to download. I am assuming that somehow, the directory for the files I download before aborting the attempt (A-C) got exchanged with the directories of the original version (A-Z), but the original directory was no where to be found.
    I decided to try an archive install in the hopes that I could just restart my computer and get the files out by hand. The archive install went fine, and the computer started up fine and got to the log-in screen, which had changed. I now had two blanks - one for user name and one for password, instead of the choices of names. I tried all my user names and passwords, and asked my wife for her names and passcodes, but nothing worked. The computer had apparently re-set all its permissions and User accounts. I tried using Disk Utility to reset the password in its opening screens, but instead of getting several User options, the only one it allowed me to attempt was "System Administrator (root)", and even that wouldn't let me in to change any passwords.
    That's when I downloaded Data Rescue II, which does seem to do a good job of locating lost files. However, since I didn't have permissions to open the computer the last time, I am still apparently facing the same thing when I try to access files copies OFF the computer.
    So I'm not out of the woods yet. I can see the files on the Data Rescue screen, but I don't know whether they have permissions tied to them or not, and if they do, whether the system would let me since I don't know what the passwords and user names have defaulted back to.
    Any advice? Please?

  • Get the creation date time of the file located in persentation server

    Hi Experts,
    I have a requirement where i need to fetch the creation date time of a file.
    ex. file path :  C:\Documents and Settings\file.xml
    I have the file path, i need to know when this file is created.
    Is there any GUI services or FM to achieve this?
    Your help in this regard is highly appreciated.
    Kind Regards,
    Vidya

    Hi Sandeep,
    Thanks for your reply.
    Can you please explain in detail the procedure to Maintain a log table & fetching the
    creation date time of a file in persentation server.
    The requirement is :
    I have the directory path, which contains many xml files. ex : C:\Documents and Settings\Dir
    I have to fetch files ,which has been created between the specified time stamp.
    ex : October 24, 2008 to December 24, 2008
    So i need to fetch all the files from the directory "Dir" which has been created between
    October 24, 2008 to December 24, 2008.
    Regards,
    Vidya

  • How to determine the creation date/time for a file?

    The important operating systems maintain both a creation date/time and last modified date/time for files. But in the File class there is only a lastModified() method. How does one determine the creation date/time for a file?

    As far as i know, there is no way to know creation time, since it is a OS dependant information.

  • Output triggred in the invoice with Date/Time 1

    Output triggred in the invoice with Date/Time as 1 i e Send with periodically scheduled job.
    So could you  let me know when this gets triggeed if we maintain 1 in condition record?
    Thanks,
    Praveen

    Hi Praveen,
    When you maintain 1in the Date/Time column in the Condition Records for O/P of say the Invoice it means that you are telling the system to send the O/P with periodically scheduled job.
    To achieve this you must use the report program RSNAST00.The message is processed through report program RSNAST00. This report program can be scheduled periodically or started manually.
    For scheduling periodically you need to set up a batch process in SM35.
    Hope this helps,
    J Nagesh

  • How to copy Log text (with Date, Time stamp ) User IDfrom BP to Transaction

    Hi Experts,
                     Can someone guide us how  to copy Log text (with Date ,Time & User ID) fron Business partner  (Prospect) to transactions by text detrmination procedure.
    Regards,
    Basavaraj Patil

    save text
    Fill out following parameters of SAVE_TEXT function module:
    HEADER
    TDOBJECT C 10 BUT000
    TDNAME C 70 10 digit BP number
    TDID C 4 Z001
    TDSPRAS C 1 Language
    INSERT = ’X’
    LINES
    TDFORMAT TDLINE
    |
    |testtttttttttttttttttttttttt( Your text)
    I would suggest you to use some other BAPI that would attach your text to BP than SAVE_TEXT.
    If you still wanted to use SAVE_TEXT then first make sure how the TDNAME is generated. It depends on the text determination procedure. For examples, it can be guid of BP, GUID followed by date or time or else the BP number itself.
    Just go to BP transaction, double click on the text pad, it will open you the SAP Script editor. Click on menu GOTO and select Header which will give you info about your TDID, TDOBJECT, TDNAME....
    Hope this helps.

  • XSLT output file with date

    Is there a way to change the Output settings for the Run Configuration of an XSLT file so that the output file contains a date/time string in its name?

    From the W3C recommendation:
    If the indent attribute has the value yes, then the html output method may add or remove whitespace as it outputs the result tree, so long as it does not change how an HTML user agent would render the output. The default value is yes.
    as you see, you won't see a different between indent="yes" and no indent attribute, as the default is "yes". have you tried "no" to see if it does anything at all?
    moreover the word may in the above sentence means the parser will do it or not...

  • HT3775 I can't open MPEG 4 -movie files with Quick time or VLC

    I can't open MPEG 4 -movie files with Quick time or VLC

    VideoLAN - Download official VLC media player for Mac OS X

Maybe you are looking for

  • Background execution of report

    With same output device and format (X_65_512/2) , the report when executed in background , the spool output is fine, in development server. However as I  do the same in quality server, the last few columns are chopped off(not displayed) what can be t

  • Backing up events in iPhoto to external hard drive

    We have photo's saved on PC's and on a MacBook Pro, in iPhoto (v11). We have all photo's from the PC's backed up on an external hard drive, in folders broken down by month/year. On the Mac in iPhoto we also now have new photo's sorted by events, name

  • CD/DVD Disc Drive Issues

    I'm having trouble with my CD/DVD disc drive.. it won't load a disc, CD nor DVD. I put it in the slot, but it doesn't catch and get pulled in. Has anyone experienced this problem and found a fix? I'm hoping that the motor isn't dead! Thanks, -Adam

  • Capturing back the excise duty paid

    Hi Gurus, My client has created an excise invoice with respect to a sales invoice.The customer has returned the goods back and now can anyone please guide me how to capture back the already paid duties and the process to be followed for cancelling th

  • Project definition system status change details

    Dear PS experts, Request, kindly let me know which report is available to show the system status change from crtd to rel rel to teco teco to clsd we would like to analyse which date or period the system status changed thru edit-status from crtd to re