How to specify Sql Loader input file with dynamic name

The input file name likes pochange_YYYYMMDD.dat which is generated by other program each day.
I want to load this file to a table.
Any help? Thanks a lot

I thought in an excellent strategy to do this:
Conditions:
- you have to have only one file in the folder with the data.
- Independently of the name of that file. A process is always going to change its name to a fix name.
- the controlfile must at another fixed path
the scripts is this one:
joel_sqlloader.bat
ren *.dat always.txt
sqlldr <user>/password data=always.txt control=<another_path>/my_ctl.ctl
- In a folder you will have these files:
* joel_sqlloader.bat
* pochange_YYYYMMDD.dat
- In another folder you will have:
* my_ctl.ctl
Did you get it ?
Joel Pérez
http://otn.oracle.com/experts

Similar Messages

  • How to call sql loader ctrl file with in the pl/sql procedure

    Hi Friends,
    I am doing a project related with the transferring data using queues. In the queue , I will get a tab delimited data in the form of CLOB variable/message. I do want to store that dat in the oracle table.
    When updating data into the table ,
    1. Don't want to write that data into a file.( Want to access directly after dequeueing from the specfic queue).
    2. As the data is in tab delimited form, I want to use sql loader concept.
    How do I call the sql loader ctrl file with in my pl/sql procedure. When I searched , most of the forums recommending external procedure or Java program.
    Please Guide me on this issue. my preferrence is pl sql, But don't know about external procedure . If no other way , I will try Java.
    I am using oracle 9.2.0.8.0.
    Thanks in advance,
    Vimal..

    Neither SQL*Loader nor external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you're going to have to roll your own parsing code. This is certainly possible. But it is going to be far less efficient than either SQL*Loader or external tables. And it's likely to involve quite a bit more code.
    The simplest possible thing that could work would be to use something like Tom Kyte's string tokenization package to read a line from the CLOB, break it into the component pieces, and then store the different tokens in a meaningful collection (i.e. an object type or a record type that corresponds to the table definition). Of course, you'll need to handle things like converting strings to numbers or dates, rejecting rows, writing log files, etc.
    Justin

  • Recive a file with dynamic name

    Hi All,
    I want to receive a file with dynamic name containing date stamp to it.... eg File_20080123.txt , File_20080122.txt etc.
    Can anybody suggest how to do it?
    Thanks,
    Atul

    Atul,
    Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
    Have u tried this option?
    See the below Solution
    Check the ASMA File for both sender/receiver channels.
    Write the below code UDF in mapping program
    //Get Input date. Don't pass anything to this UDF except the Date.
    //Map the output to the root node of the target.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fname = conf.get(key);
    String ret = fname"_"Date
    return "";
    raj.
    Edited by: Raj on Jan 23, 2008 4:09 PM

  • FTP Activity - mget multiple files with dynamic names

    Hello All
    Hope all is well.
    I was wondering if there was a way to configure FTP activity to transfer multiple files with dynamic names from source location at daily intervals.
    For example, my source files are affixed with date values (source_filename_<mmddyyyy>_<hh>.txt):
    source_filename_12252009_00.txt
    source_filename_12252009_06.txt
    source_filename_12252009_12.txt
    source_filename_12252009_18.txt
    What I would like my process flow to do would be to download just these 4 files once daily based on a dynamic ftp script as follows:
    open ${Remote.Host}
    ${Remote.User}
    ${Remote.Password}
    cd ${Remote.RootPath}
    prompt off
    mget ????????
    quit
    In DOS batch script you would have the mget command with a wildcard as:
    mget source_filename_%DATE:~0,2%%DATE:~2,2%%DATE:~4,4%*.txt
    How does one go about implementing this in OWB? Does it require a user defined substitution varilable of some sort?
    FYI, I am using version 10gR2.
    Cheers.

    Hi ,
    If you are able to achieve your objective from a DOS batch script then you can call that script for an User Defined Activity in OWB process flow .
    Hope this helps.
    Thanks,
    Sutirtha

  • Problem specifying SQL Loader Log file destination using EM

    Good evening,
    I am following the example given in the 2 Day DBA document chapter 8 section 16.
    In step 5 of 7, EM does not allow me to specify the destination of the SQL Loader log file to be on a mapped network drive.
    The question: Does SQL Loader have a limitation that I am not aware of, that prevents placing the log file on a network share or am I getting this error because of something else I am inadvertently doing wrong ?
    Note: I have placed the DDL, load file data and steps I follow in EM at the bottom of this post to facilitate reproducing the problem *(drive Z is a mapped drive)*.
    Thank you for your help,
    John.
    DDL (generated using SQL developer, you may want to change the space allocated to be less)
    CREATE TABLE "NICK"."PURCHASE_ORDERS"
        "PO_NUMBER"      NUMBER NOT NULL ENABLE,
        "PO_DESCRIPTION" VARCHAR2(200 BYTE),
        "PO_DATE" DATE NOT NULL ENABLE,
        "PO_VENDOR" NUMBER NOT NULL ENABLE,
        "PO_DATE_RECEIVED" DATE,
        PRIMARY KEY ("PO_NUMBER") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING TABLESPACE "USERS" ENABLE
      SEGMENT CREATION DEFERRED PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
        INITIAL 67108864
      TABLESPACE "USERS" ;
    Load.dat file contents
    1, Office Equipment, 25-MAY-2006, 1201, 13-JUN-2006
    2, Computer System, 18-JUN-2006, 1201, 27-JUN-2006
    3, Travel Expense, 26-JUN-2006, 1340, 11-JUL-2006
    Steps I am carrying out in EM
    log in, select data movement -> Load Data from User Files
    Automatically generate control file
    (enter host credentials that work on your machine)
    continue
    Step 1 of 7 ->
      Data file is located on your browser machine
      "Z:\Documentation\Oracle\2DayDBA\Scripts\Load.dat"
       click next
    step 2 of 7 ->
      Table Name
      nick.purchase_orders
      click next
    step 3 of 7 ->
      click next
    step 4 of 7 ->
      click next
    step 5 of 7 ->
      Generate log file where logging information is to be stored
      Z:\Documentation\Oracle\2DayDBA\Scripts\Load.LOG
      Validation Error
      Examine and correct the following errors, then retry the operation:
      LogFile - The directory does not exist.

    Hi John,
    But, i did'nt found any error when i am going the same what you did.
    My Oracle Version is 10.2.0.1 and using Windows xp. See what i did and i got worked
    1.I created one table in scott schema :
    SCOTT@orcl> CREATE TABLE "PURCHASE_ORDERS"
      2  (
      3      "PO_NUMBER"      NUMBER NOT NULL ENABLE,
      4      "PO_DESCRIPTION" VARCHAR2(200 BYTE),
      5      "PO_DATE" DATE NOT NULL ENABLE,
      6      "PO_VENDOR" NUMBER NOT NULL ENABLE,
      7      "PO_DATE_RECEIVED" DATE,
      8      PRIMARY KEY ("PO_NUMBER") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING TABLESPACE "USERS" ENABLE
      9  )
    10  TABLESPACE "USERS";
    Table created.I logged into em Maintenance-->Data Movement-->Load Data from User Files-->My Host Credentials
    Here i total 3 text boxes :
    1.Server Data File : C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    2.Data File is Located on Your Browser Machine : z:\load.dat <--- Here z:\ means other machine's shared doc folder; and i selected this option (as option button click) and i created the same load.dat as you mentioned.
    3.Temporary File Location : C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ <--- I did'nt mentioned anything.
    Step 2 of 7 Table Name : scott.PURCHASE_ORDERS
    Step 3 of 7 I just clicked Next
    Step 4 of 7 I just clicked Next
    Step 5 of 7 I just clicked Next
    Step 6 of 7 I just clicked Next
    Step 7 of 7 Here it is Control File Contents:
    LOAD DATA
    APPEND
    INTO TABLE scott.PURCHASE_ORDERS
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    PO_NUMBER INTEGER EXTERNAL,
    PO_DESCRIPTION CHAR,
    PO_DATE DATE,
    PO_VENDOR INTEGER EXTERNAL,
    PO_DATE_RECEIVED DATE
    And i just clicked on submit job.
    Now i got all 3 rows in purchase_orders :
    SCOTT@orcl> select count(*) from purchase_orders;
      COUNT(*)
             3So, there is no bug, it worked and please retry if you get any error/issue.
    HTH
    Girish Sharma

  • How can I automatically create the files with serie-name?

    Hello, Everyone,
    I have a question again.
    How can I automatically create the file with a serie-filename?
    e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
    How can I do it?`
    Thanks a lot.
    Regarts,
    Johnny

    Hi Deepu,
    one more comment
    The format code should be "%04d" to get leading zeros and have filenames with same length...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Help - loading updated files with same name

    CS4
    When updating files with same name my CS4 automatically puts an extension _000
    I think it should ask me if I want to replace the existing file.  Is there a switch or setting that I need to change?
    Thanks.
    Alan

    Please find the solution in thread, http://forums.adobe.com/thread/707897?tstart=0.
    Hope this helps you.

  • How to skip footer record in SQL*Loader input file

    I have am using SQL*Loader in a batch import process.
    The input files to SQL*Loader have a header record and footer record - always the 1st and last records in the file.
    I need SQL*Loader to ignore these two records in every file when performing the import. I can easily ignore the header by using the SKIP function.
    Does anybody know how to ignore the last record (footer) in an input file??
    I do not want to physically pre-strip the footer since the business want all data files to have the header and footer records.

    Thanks - how do I use the when clause to specify the last line of the input file?
    I am presuming it requires me to have a unique identifier at a given position on that last line. If I don't have such an identifier can I still use your solution?
    Cheers Why not putting an idetifier at the end of your input file: echo "This_is_the_End" >> input_file ?

  • How do i use an input file with Asian characters(Unicode)?

    /* Ardor
    * Illiteraminator.java
    * Version beta 1.0
    * December 7, 2007
    * Main interfacing class
    import java.io.*;
    import java.util.*;
    public class Illiteraminator{
      public static void main (String [] args){
      //  ArrayList<Word> dictionary = new ArrayList<Word>();
        String fileName = "Mandrin.txt";
        String character= "",definition = "",inputLine;
        try{
          Scanner fileScan = new Scanner (new File (fileName));
          while (fileScan.hasNext()){
            inputLine = fileScan.nextLine();
            Scanner sc = new Scanner(inputLine);
            character = sc.next();
            while (sc.hasNext()){
              definition = definition + " " + sc.next();
            }//end while sc
           // dictionary.add(new Word(character, definition));
            //definition = "";
            //character = "";
          }//end while fileScan
        } catch (FileNotFoundException e){
          System.out.println("File not found, dig around for Mandrin.txt");
          System.exit(1);
        }//end catch
        System.out.println(character);
        System.out.println(definition);
      }//end main
    }//end class IlliteraminatorHi, i'm a first time programmer. Never touched programming until i took a Java class in university last semester. I am currently attempting to write a program to help me move away from my illiteracy in Mandrin. So, that's my code, and i am using Dr.Java while writing it. When i tested it out the output looked something like this v
    A p p l e
    M o n k e y C a t D o n k e y
    My input file is saved in Unicode. It contains letters that cannot be saved in ANSI. I tried UTF-8, but the interactions section showed no output...
    Is this just a problem with Dr.Java? Will i encounter a similar problem when i turn this into a GUI?
    The following is a copy and pasted version of the txt file i used as input. It is saved in the Unicode format.
    &#30340;[de] <grammatical particle marking genitive as well as simple and composed adjectives>; &#25105;* w&#466;de my; &#39640;* g&#257;ode high, tall; &#26159;* sh�de that's it, that's right; &#26159;...* sh�...de one who...; &#20182;&#26159;&#35828;&#27721;&#35821;*. T&#257; sh� shu&#333; H�ny&#468;de. He is one who speaks Chinese. [d�] &#30446;* m�d� goal [d�] true, real; *&#30830; d�qu� certainly
    &#19968;(A&#22777;)     [y&#299;] one, a little; &#31532;* d�-y&#299; first, primary; &#30475;*&#30475; k�ny&#299;k�n have a (quick) look at [y�] (used before tone #4); *&#20010;&#20154; y� g� r�n one person; *&#23450; y�d�ng certain; *&#26679; y�y�ng same; *&#26376;y�yu� January [y�] (used before tones #2 and #3); *&#28857;&#20799; y�di&#462;nr a little; *&#20123; y�xi&#275; some {Compare with &#24186;(F&#20040;) y&#257;o, which also means "one"}
    &#26159;     [sh�] to be, *&#19981;*? sh�bush�? is (it) or is (it) not?; *&#21542; sh�f&#466;u whether or not, is (it) or is (it) not?

    Sorry, but i do not understand this post at all... Can anyone explain it to me? Is he saying my IDE is running on something other than Unicode?
    PS: I tried one of the Scanner constructors that takes a charset parameter. That fixed the odd output! However, every Chinese character has been replaced with a question mark. (It was a series of weird characters before i used the constructor with a charset parameter.)

  • Loading swf file with dynamic text

    For a website I'm creating I'm going to have a main swf file
    that loads individual swf files for each page. Each page's swf file
    loads in external text files through dynamic text boxes so i can
    edit the website easily. To load the swf files into the main swf
    file I'm using the loader component. Everything works fine except
    thedynamic text boxes of the swf files that are nestled in the main
    one do not load properly. Instead, in each text box i get a message
    similar to this:
    _level0.NewsLoader.contentHolder.News1
    NewsLoader is the instance of the loader component, and News1
    is a variable called in through a dynamic text field from the html
    document entitled News1.html. The individual news swf file loads
    the text properly, but when the news swf file is loaded into the
    main swf file the text is replaced with the message above.
    Any suggestions?

    the problem might be due to the changed references if you
    load the movie into another one.
    is NewsLoader a MovieClip instance inside the main movie or
    inside the mc that is loaded into the main movie?
    If it resides inside the exteranly loaded movie, you will
    either need to use the lockroot attribute or use a relative
    reference to the News1 variable.
    Since the _level0 always points to the _root timeline (the
    one of the outer most movieclip) _level0 used in the external mc is
    different once the external movieclip is loaded into another movie.
    I suggest only using relative references, makes live much
    easier.

  • Source files with dynamic name

    Hi,
    Is there a way to load from a variable file name sources, for example file name with date postfix, something like this: INPUT_DEPT_20070313.txt ??
    Or i must create an external process in the process flow wich is to rename the file every time to a fix name then load ??
    Thanks.

    Correct. If you are using SQL*Loader mapping, then put a transformation before the mapping in your process flow. If you are using external tables (PL/SQL mapping), then put a premapping procedure in the mapping. And yes, use UTL_FILE package to rename the file.
    Greetings,
    Mate

  • Pick the file with dynamic name

    Dear All
    My scenario is file to idoc.
    legacy system generates file with a file name as current date.txt which keeps on changing
    eg:   on 9th july file name is 09072009.txt and
           on 10thjuly filename would be 10072009.txt
    How do i pick such file and process it?
    What should be the File Name in the sender communication channel?
    Please help me in resolving this issue
    Thanks
    Bhasker

    Hello Baskar Raj,
        Your requierement can be acheived by using the combination of UDF and ASMA(AdapterSpecifieMessageAttriburrtes) which helps us greatly in meeting dynamic filename rquirements.
    1.You have to enable either FIlename,Time stamp or all the he ASMA in the sender side communication channel .
    2.Write the UDF that gets the file name (CURRENT DATE.txt)during runtime that is available from enabling ASMA in sender communication channel .
    3.change it to the name u want to modify (Replace with the new file name by getting time stamp from the ASMA attributes.
    4. Map the UDF output to any of the target nodes(can be messagetype node MT_ur msg type name).
    5.Enable ASMA on the target side also in that chek same file name.
    Code to be writen in UDF is mentioned by sunilchandra in the below thread u jus need to avoid filename in that and use only date format it will acheive ur requrement.
    Re: Regarding Target File name
    Thanks,
    Ram.

  • Tag File with dynamic name

    I need to include a page with a name I do not know in advance. I can do this with <jsp:include page="${filename}"/>.
    Can I also do it somehow using tag files?

    Atul,
    Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
    Have u tried this option?
    See the below Solution
    Check the ASMA File for both sender/receiver channels.
    Write the below code UDF in mapping program
    //Get Input date. Don't pass anything to this UDF except the Date.
    //Map the output to the root node of the target.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fname = conf.get(key);
    String ret = fname"_"Date
    return "";
    raj.
    Edited by: Raj on Jan 23, 2008 4:09 PM

  • How to auto populate numerous pdf files with same name and address?

    I have numerous pdf files where a company's name and address will need to be entered onto each file.  Would there be a way to enter this information once, say on an excel file or something, and then have this information auto populate all the correct fields in each and every pdf file I have to fill out.  I am a complete rookie with Adobe Acrobat.  At any one's convenience please let me know or point me in a direction where I can possibly learn this for myself.  If Adobe offers this type of service please let me know which department to contact.
    Thanks,
    John

    If you were an InDesign user, you could layout the document there, and use the Data Merge feature to bring in the names and addresses from Excel. Then create a PDF of the resulting file which could be split into individual PDFs.
    There might be a way to do it similarly with Microsoft Word and Mail Merge.

  • SSIS 2008 - Sending file with dynamic name using FTP task

    Hi  - Thanks for taking a look -  (I'm very new to SSIS.)
    I'm trying to create an SSIS 2008 package that does the following:
    1) Execute a stored procedure on SQL.
    2) Download the results as a CSV file to a 'local' location.  The file name is set using a variable ("User::LocalFilePath") dynamically based on the current time:
    @[User::LocalFilePath] + "GreatReportName_" + "_" +(DT_STR,4,1252) DatePart("yyyy",getdate()) + Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) + "_" + Right("0"
    + (DT_STR,4,1252) DatePart("d",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +  "_" + Right("0" + (DT_STR,4,1252) DatePart("mi",getdate()),2)
    + "_" +  Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".csv"
    3) Transfer the CSV file to an FTP site.
    4) Delete the CSV file from the 'local' location.
    I've been able to do steps 1 and 2 so far.  However when trying the move the newly created file to the FTP site I get the error:
    "Error: 0xC002917C at Send to FTP, FTP Task: The variable "User::LocalFilePath" doesn't contain file path(s)."
    (When I set the "IsLocalPathVariable" to "False" and use a file previously created the file is correctly transferred to the FTP site.  This proves that the FTP details are correct and that the "RemotePathVariabe" is working
    correctly.)
    I have set the variable ("User::LocalFilePath") to "EvaluateAsExpression" in the variable properties.
    Can anyone help?
    Many Thanks,
    UnoT

    Hi Vaibhav,
    Thanks for your response.  I set the "DelayValidation" to "True".  However
    that didn't make any difference.
    I added in all the breakpoints, but it didn't give any results (I may be doing this incorrectly?):
    Any other suggestions?
    Thanks,
    UnoT

Maybe you are looking for

  • HT5622 How do I remove my credit card detail from my account

    How do I remove my credit card detail from my account?

  • Prompt Value is not working through Open Doc Syntax

    Dear All, I am passing one value (Fiscal Year) to WebI from Xcelsius URL Button. http://<Server>:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=ATJUDThT5S5DivTWVfoq6Rs&sIDType=CUID&sRefresh=Y&lsSFiscalYear(SingleValueEntry,+Required):= [K4/2010] W

  • Automatic Updates Never Work

    In all the years I have been using Skype desktop client, I don't think it has ever auto-updated itself despite this feature being enabled (and on several different computers). I am currently running Windows 8.1 Pro (fully up to date). Today I perform

  • Can't Restore User, Settings, And Files

    Hi. I had a user account with a misspelled "full name" and therefore a misspelled home folder name. I followed apple's directions to change these issues here: Change your OS X account name and home directory name - Apple Support When I followed these

  • Missing base system device

    My device does not have  base system device.