Mapping and loading  single ASCII file into multiple tables in ODI

We get an ASCII file that contains several different transactions (records) and I need to validate and map each record to different table in the target database using Oracle Data Integrator tool. Is it possible ? If so, how and how difficult it is ?
I would appreciate a quick response.
Thanks,
Ram

Hi Madha,
Using Demo version, we are trying to load data from ASCII file. When trying to execute, we are getting the following error:
7000 : null : com.sunopsis.jdbc.driver.file.a.icom.sunopsis.jdbc.driver.file.a.i
at com.sunopsis.jdbc.driver.file.a.f.getColumnClassName(f,java)
at com.sunopsis.sql.e.a(e.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
The file has all text fields and no date fields. we made sure that there is data for all fields being loaded.
Question is whether there is any problem in creating data in the Demo database which cameup with installation?
I mean, do we need to create any privileges to insert/add/delete ? We are running this as user SUPVERVISOR .
I appreciate if you can respond to this.
thanks,
Ram

Similar Messages

  • How to load a XML file into a table

    Hi,
    I've been working on Oracle for many years but for the first time I was asked to load a XML file into a table.
    As an example, I've found this on the web, but it doesn't work
    Can someone tell me why? I hoped this example could help me.
    the file acct.xml is this:
    <?xml version="1.0"?>
    <ACCOUNT_HEADER_ACK>
    <HEADER>
    <STATUS_CODE>100</STATUS_CODE>
    <STATUS_REMARKS>check</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>2</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>3</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic administration</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>4</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>5</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    <HEADER>
    <STATUS_CODE>500</STATUS_CODE>
    <STATUS_REMARKS>process exception</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>20</SEGMENT_NUMBER>
    <REMARKS> base polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>30</SEGMENT_NUMBER>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>40</SEGMENT_NUMBER>
    <REMARKS> base polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>50</SEGMENT_NUMBER>
    <REMARKS> base polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    </ACCOUNT_HEADER_ACK>
    For the two tags HEADER and DETAILS I have the table:
    create table xxrp_acct_details(
    status_code number,
    status_remarks varchar2(100),
    segment_number number,
    remarks varchar2(100)
    before I've created a
    create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
    and after, can you give me a script for loading data by using XMLTABLE?
    I've tried this but it doesn't work:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    This should allow me to get something like this:
    select * from xxrp_acct_details;
    Statuscode status remarks segement remarks
    100 check 2 rp polytechnic
    100 check 3 rp polytechnic administration
    100 check 4 rp polytechnic finance
    100 check 5 rp polytechnic logistics
    500 process exception 20 base polytechnic
    500 process exception 30
    500 process exception 40 base polytechnic finance
    500 process exception 50 base polytechnic logistics
    but I get:
    Error report:
    ORA-06550: line 19, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    and if I try to change the script without using the column HEADER_NO to keep track of the header rank inside the document:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    I get this message:
    Error report:
    ORA-19114: error during parsing the XQuery expression: 
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 4
    19114. 00000 -  "error during parsing the XQuery expression: %s"
    *Cause:    An error occurred during the parsing of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    My oracle version is 10gR2 Express Edition
    I do need a script for loading xml files into a table as soon as possible, Give me please a simple example for understanding and that works on 10gR2 Express Edition
    Thanks in advance!

    The reason your first SQL statement
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    returns the error you noticed
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    is because Oracle is expecting XML to be passed in.  At the moment I forget if it requires a certain format or not, but it is simply expecting the value to be wrapped in simple XML.
    Your query actually runs as is on 11.1 as Oracle changed how that functionality worked when 11.1 was released.  Your query runs slowly, but it does run.
    As you are dealing with groups, is there any way the input XML can be modified to be like
    <ACCOUNT_HEADER_ACK>
    <ACCOUNT_GROUP>
    <HEADER>....</HEADER>
    <DETAILS>....</DETAILS>
    </ACCOUNT_GROUP>
      <ACCOUNT_GROUP>
      <HEADER>....</HEADER>
      <DETAILS>....</DETAILS>
      </ACCOUNT_GROUP>
    </ACCOUNT_HEADER_ACK>
    so that it is easier to associate a HEADER/DETAILS combination?  If so, it would make parsing the XML much easier.
    Assuming the answer is no, here is one hack to accomplish your goal
    select x1.status_code,
            x1.status_remarks,
            x3.segment_number,
            x3.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc as "d",
      columns detail_no      for ordinality,
              detail_xml     xmltype       path 'DETAIL'
    ) x2,
    xmltable(
      'DETAIL'
      passing x2.detail_xml
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS') x3
    WHERE x1.header_no = x2.detail_no;
    This follows the approach you started with.  Table x1 creates a row for each HEADER node and table x2 creates a row for each DETAILS node.  It assumes there is always a one and only one association between the two.  I use table x3, which is joined to x2, to parse the many DETAIL nodes.  The WHERE clause then joins each header row to the corresponding details row and produces the eight rows you are seeking.
    There is another approach that I know of, and that would be using XQuery within the XMLTable.  It should require using only one XMLTable but I would have to spend some time coming up with that solution and I can't recall whether restrictions exist in 10gR2 Express Edition compared to what can run in 10.2 Enterprise Edition for XQuery.

  • Loading an XML file into the table without creating a directory .

    Hi,
    I wanted to load an XML file into a table column . But I should not create a directory in the server and placing the XML file there and giving the path in the insert query. Can anybody help me here?
    Thanks in advance.

    You could write a java stored procedure that retrieves the file into a clob. Wrap that in a function call and use it in your insert statement.
    This solution require read privileges granted by sys and is therefore only feasible if the top-level directory/directories are known or you get read-access to everything.

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • How to load a XML file into a table using PL/SQL

    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.

    ODI_NewUser wrote:
    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.
    Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
    This is the xml file
    karthick% cat emp_details.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09-JUN-1981</HIREDATE>
      <SAL>2450</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17-NOV-1981</HIREDATE>
      <SAL>5000</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>
    You can write a query like this.
    SQL> select *
      2    from xmltable
      3         (
      4            '/ROWSET/ROW'  passing xmltype
      5            (
      6                 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
      7               , nls_charset_id('AL32UTF8')
      8            )
      9            columns empno    number      path 'EMPNO'
    10                  , ename    varchar2(6) path 'ENAME'
    11                  , job      varchar2(9) path 'JOB'
    12                  , mgr      number      path 'MGR'
    13                  , hiredate varchar2(20)path 'HIREDATE'
    14                  , sal      number      path 'SAL'
    15                  , com      number      path 'COM'
    16                  , deptno   number      path 'DEPTNO'
    17         );
         EMPNO ENAME  JOB              MGR HIREDATE                    SAL        COM     DEPTNO
          7782 CLARK  MANAGER         7839 09-JUN-1981                2450          0         10
          7839 KING   PRESIDENT            17-NOV-1981                5000          0         10
    SQL>

  • Error loading local CSV file into external table

    Hello,
    I am trying to load a CSV file located on my C:\ drive on a WIndows XP system into an 'external table'. Everyting used to work correctly when using Oracle XE (iinstalled also locally on my WIndows system).
    However, once I am trynig to load the same file into a Oracle 11g R2 database on UNIX, I get the following errr:
    ORA-29913: Error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    error opening file ...\...\...nnnnn.log
    Please let me know if I can achieve the same functionality I had with Oracle XP.
    (Note: I cannot use SQL*Loader approach, I am invoking Oracle stored procedures from VB.Net that are attempting to load data into external tables).
    Regards,
    M.R.

    user7047382 wrote:
    Hello,
    I am trying to load a CSV file located on my C:\ drive on a WIndows XP system into an 'external table'. Everyting used to work correctly when using Oracle XE (iinstalled also locally on my WIndows system).
    However, once I am trynig to load the same file into a Oracle 11g R2 database on UNIX, I get the following errr:
    ORA-29913: Error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    error opening file ...\...\...nnnnn.log
    Please let me know if I can achieve the same functionality I had with Oracle XP.
    (Note: I cannot use SQL*Loader approach, I am invoking Oracle stored procedures from VB.Net that are attempting to load data into external tables).
    Regards,
    M.R.So your database is on a unix box, but the file is on your Windows desktop machine? So .... how is it you are making your file (on your desktop) visible to your database (on a unix box)???????

  • How do you convert a single audio file into multiple tracks?

    Ive got a cassette tape that I captured. Now I want that single file to be chopped up into multiple tracks.
    from there, can we burn to cd with the multi tracks? or do we need another cd burner program?
    also the only way Ive been able to get rid of big pops is highlight them and cut them out. the automated processes have not been able to do this for me.
    is there a procedure somewhere for this that I can follow?
    thanks for your assistance.
    best, M/

    Jimi
    this is exactly what I did with a previous cd. I thought it seemed like the long way round.
    was hoping for a more automated solution.
    when I came from XP land, I used to use Premiere Pro 2.0 and there was a Pro editing software that came with the Premiere suite, I forgot what it was called, but it did that automatically after adding markers and it was way better at eliminating clicks and pops.
    there was a view you could use where you could see the annoying noises by looking at it using several differnt views (like looking at an infared image).
    definetly had its advantages but I could not keep XP running. I got errors, blue screens, viruses, spywares, costs lots of money to fix an lots of downtime.
    so far the mac as worked without any major glitches (touching wood)
    best, M/

  • Loading XML files into multiple tables

    I've got XML like so...
    <?xml version="1.0" encoding="UTF-8"?>
    <MainTitle Version="1.0" Date="2009-01-11">
    <MainName>
    <ID1>A</ID1>
    <ID2>ABC</ID2>
    <ID3>ABC123</ID3>
    <Desc>Some text</Desc>
    <feature>f1</feature>
    <feature>f2</feature>
    <Category>
    <name>n1</name>
    <attribute>more stuff</attribute>
    </Category>
    <Category>
    <name>n2</name>
    <attribute>even more stuff</attribute>
    </Category>
    <Category>
    <name>n3</name>
    <attribute>different stuff</attribute>
    </Category>
    <Category>
    <name>n4</name>
    <attribute>More of the same<attribute>
    <attribute>But different still</attribute>
    <attribute>Even more different junk<attribute>
    </Category>
    </MainName>
    </MainTitle>
    Where each MainName instance in the file can have 0 or more ( unbounded ) Category and Feature tags and each Category instance can have multiple attribute tags. The file contains many thousands of MainName instances and has embedded a good mix of possible tags.
    I believe I can load this into 9i xmltype table or a 9i table with an xmltype column, then query the data to get it out...
    SQL> create table mytab (
    2 xmlraw XMLType
    3 );
    Table created.
    SQL>
    SQL> insert into mytab values ( sys.xmltype.createxml(
    2 '<?xml version="1.0" encoding="UTF-8"?>
    3 <MainTitle Version="1.0" Date="2009-01-11">
    4 <MainName>
    5 <ID1>A</ID1>
    6 <ID2>ABC</ID2>
    7 <ID3>ABC123</ID3>
    8 <Desc>Some text</Desc>
    9 <feature>f1</feature>
    10 <feature>f2</feature>
    11 <Category>
    12 <name>n1</name>
    13 <attribute>more stuff</attribute>
    14 </Category>
    15 <Category>
    16 <name>n2</name>
    17 <attribute>even more stuff</attribute>
    18 </Category>
    19 <Category>
    20 <name>n3</name>
    21 <attribute>different stuff</attribute>
    22 </Category>
    23 <Category>
    24 <name>n4</name>
    25 <attribute>More of the same</attribute>
    26 <attribute>But different still</attribute>
    27 <attribute>Even more different junk</attribute>
    28 </Category>
    29 </MainName>
    30 </MainTitle>')
    31 );
    1 row created.
    1 select
    2 extract(a.xmlraw,'/MainTitle/MainName/ID1/text()'),
    3 extract(a.xmlraw,'/MainTitle/MainName/ID2/text()'),
    4 extract(a.xmlraw,'/MainTitle/MainName/ID3/text()'),
    5 extract(a.xmlraw,'/MainTitle/MainName/Desc/text()'),
    6 extract(a.xmlraw,'/MainTitle/MainName/feature/text()'),
    7 extract(a.xmlraw,'/MainTitle/MainName/Category/text()'),
    8 extract(a.xmlraw,'/MainTitle/MainName/Category/name/text()'),
    9 extract(a.xmlraw,'/MainTitle/MainName/Category/attribute/text()')
    10* from mytab a
    SQL> /
    A
    ABC
    ABC123
    Some text
    f1f2
    n1n2n3n4
    more stuffeven more stuffdifferent stuffMore of the sameBut different stillEven
    more different junk
    This all works just fine, however, it's not quite what I need. For starters, the multiple tag data is concatenated and when I try to specifically query it out using a where clause I get ORA 22950. So, not sure how to deal with that.
    Is it possible to use sqlldr to get the 200MB XML file loaded into a table like that above?
    Now, given multiple "feature" and "category" data per "MainName", I need to use the SQL to dump the XML data into a set of tables built to model the structure of the XML...
    roughly..
    Main_Table (
    ID1 Varchar2(10)
    ID2 varchar2(10)
    ID3 varchar2(10)
    desc varchar2(100)
    Features_Table (
    ID1 varchar2(10)
    feature varchar2(100)
    Category_Table (
    ID1 varchar2(10)
    name varchar2(100)
    attribute varchar2(100)
    What are the groups recommendations here? Should I continue down this route or is there a better way?

    When I suggested the option to parse the XML in PL/SQL I was referring to pulling the data into PL/SQL and then performing all parsing activity against the PL/SQL copy and you don't need to make SQL calls.
    Here is a quick sample for parsing out all the Category/name elements from the XML once it is loaded into PL/SQL
    DECLARE
      l_index     PLS_INTEGER;
      l_category  XMLTYPE;
      l_db_row    XMLTYPE := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
    <MainTitle Version="1.0" Date="2009-01-11">
       <MainName>
          <ID1>A</ID1>
          <ID2>ABC</ID2>
          <ID3>ABC123</ID3>
          <Desc>Some text</Desc>
          <feature>f1</feature>
          <feature>f2</feature>
          <Category>
             <name>n1</name>
             <attribute>more stuff</attribute>
          </Category>
          <Category>
             <name>n2</name>
             <attribute>even more stuff</attribute>
          </Category>
          <Category>
             <name>n3</name>
             <attribute>different stuff</attribute>
          </Category>
          <Category>
             <name>n4</name>
             <attribute>More of the same</attribute>
             <attribute>But different still</attribute>
                   <attribute>Even more different junk</attribute>
              </Category>
         </MainName>
    </MainTitle>');
    BEGIN
       l_index := 1;
       WHILE l_db_row.Existsnode('/MainTitle/MainName/Category[' ||
                                 To_Char(l_index) || ']') > 0
       LOOP
          l_category := l_db_row.Extract('/MainTitle/MainName/Category[' ||
                                           To_Char(l_index) || ']');
          dbms_output.put_line(l_category.extract('Category/name/text()').getStringVal());
          l_index := l_index + 1;
       END LOOP;
    END;You could repeat the WHILE loop to parse out the attribute column as well since it repeats. This is what Dave's post was showing and what I was referring to.
    Hint: If you are trying to use .extract to go after an optional node, you need to verify the node exists via existsNode first. If you don't you can get an "ORA-30625: method dispatch on NULL SELF argument is disallowed" error when trying to extract a non-existent node.

  • Loading a CSV file into a table

    HTML DB Data Workshop has a feature to load a CSV file and create a table based on it.
    I use a simplified version of this feature in my applications.
    See a quick demo at
    http://htmldb.oracle.com/pls/otn/f?p=38131:1
    Create a small csv file like
    col1,col2,col3
    varchar2(10),number,"number(10,2)"
    cat,2,3.2
    dog,99,10.4
    The first line in the file are column names
    Second line are their datatypes.
    Save the file as c:\test.csv
    Click the Browse button, search for this file.
    Click the Submit button to upload and parse the file.
    You can browse the file contents.
    If you like what you see, type in a table name and click the Create Table button to create a table.
    Let me know if anyone is interested and I can post the code.
    Hope this helps.
    Message was edited by:
    Vikas
    Message was edited by:
    Vikas

    Hi Vikas,
    I tried to import your COOL application into html db at http://htmldb.oracle.com and got the error:
    "Expecting p_company or wwv_flow_company cookie to contain security group id of application owner.
    Error ERR-7621 Could not determine workspace for application (:) on application accept.
    OK "
    The SAME error I get when trying to import Scott's Photo Catalog at http://htmldb.oracle.com/pls/otn/f?p=18326:7:6703988766288646534::::P7_ID:2242.
    What should I change in the exported script in addition to change your workspace schema VIKASA or Scott's STUDIO_SHOWCASE to my NICED68?
    Thanks!
    DC

  • Loading a CSV file into a table as in dataworkshop

    Data Workshop has a feature to load a CSV file and create a table based on it, similarly i want to create it in my application.
    i have gone through the forum http://forums.oracle.com/forums/thread.jspa?threadID=334988&start=60&tstart=0
    but could not download all the files(application , HTMLDB_TOOLS package and the PAGE_SENTRY function) couldnt find the PAGE_SENTRY function.
    AND when i open this link http://apex.oracle.com/pls/apex/f?p=27746
    I couldn't run the application. I provided a CSV file and when I click SUBMIT, I got the error:
    ORA-06550: line 1, column 7: PLS-00201: identifier 'HTMLDB_TOOLS.PARSE_FILE' must be declared
    tried it in apex.oracle.com host as given in the previous post.
    any help pls..,
    any other method to load data into tables.., (similar to dataworkshop)

    hi jari,
    I'm using the HTMDB_TOOLS to parse my csv files,It works well for creating a report, but if i want to create a new table and upload the data giving error *"missing right parenthesis"*
    I've been looking through the package body and i think there is some problem in the code,
            IF (p_table_name is not null)
            THEN
              BEGIN
                execute immediate 'drop table '||p_table_name;
              EXCEPTION
                WHEN OTHERS THEN NULL;
              END;
              l_ddl := 'create table '||p_table_name||' '||v(p_ddl_item);
              htmldb_util.set_session_state('P149_DEBUG',l_ddl);
              execute immediate l_ddl;
              l_ddl := 'insert into '||p_table_name||' '||
                       'select '||v(p_columns_item)||' '||
                       'from htmldb_collections '||
                       'where seq_id > 1 and collection_name='''||p_collection_name||'''';
              htmldb_util.set_session_state('P149_DEBUG',v('P149_DEBUG')||'/'||l_ddl);
              execute immediate l_ddl;
              RETURN;
        END IF;it is droping table but not creating new table.
    P149_DEBUG contains create table EMP_D (Emp ID number(10),Name varchar2(20),Type varchar2(20),Join Date varchar2(20),Location varchar2(20))and if i comment the
              BEGIN
                execute immediate 'drop table '||p_table_name;
              EXCEPTION
                WHEN OTHERS THEN NULL;
              END;
              l_ddl := 'create table '||p_table_name||' '||v(p_ddl_item);
              htmldb_util.set_session_state('P149_DEBUG',l_ddl);
              execute immediate l_ddl;then it is working well, i.e i enter the exsisting table name then i works fine, inserting the rows.
    but unable to create new table
    can you pls help to fix it.
    Regards,
    Little Foot

  • How can I use sql loader to load a text file into a table

    Hi, I need to load a text file that has records on lines tab delimited into a table. How would I be able to use the sql loader to do this? I am using korn shell to do this. I am very new at this...so any kind of helpful examples or documentation would be very appreciated. I would love to see some examples to help me understand if possible. I need help! Thanks alot!

    You should check out the documentation on SQL*Loader in the online Oracle document titled Utilities. Here's a link to the 9iR2 version of it: http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96652/part2.htm#436160
    Hope this helps.

  • How to load a txt file into a table

    Hi,
    I have a txt file
    3 sample records:
    25     fff     fff     2012-03-08 13:42:31.0     2012-03-15 14:58:31.0
    26     ooo     ooo     null     null
    27     ooo     ooo     2012-03-22 10:39:49.0     null
    I have problems with the nulls:
    my ctl is like that:
    load data
    append
    into table table_name
    fields terminated by '\t'
    OPTIONALLY ENCLOSED BY '"' AND '"'
    trailing nullcols
    ( ID CHAR(4000),
    LITERAL CHAR(4000),
    DESCRIPTION_WEB CHAR(4000),
    FECHAALTA TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF1",
    FECHAMODIFICACION TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF1"
    I get the following error because of the null:
    Record 2: Rejected - Error on table MKT_WEB, column FECHAALTA.
    ORA-26041: DATETIME/INTERVAL datatype conversion error
    The table in the database:
    ID     NUMBER(10,0)
    LITERAL     VARCHAR2(40 CHAR)
    DESCRIPTION     VARCHAR2(255 CHAR)
    FECHAALTA     TIMESTAMP(0)
    FECHAMODIFICACION     TIMESTAMP(0)
    How can I say to the CTL about the nulls?
    Thanks in advance

    Try external table

  • Reading and loading a flat file to a table by line by line

    Hi All
    My requirement is like this, i receive a daily a file which are having transaction realted data,
    For ex: The first row will also have the transaction num and the second and third rows will be transaction realted infomation and in the 4th record i will have new transaction num and the following rows are realted to 2nd trans num details In the flat file i able to identify which record is transn num related data, now the issue will be the following will not have the transaction num informations, blindly 2 and 3 rows are having transaction num1 info only
    TRAN123
    'SALE'
    '450'
    TRAN245
    'SALE'
    '123'
    my output : TRAN123 is having a sale of 450 and TRAN245 is having a sale 123
    For this i need to read the data from the flat file by an order only
    Thanks
    Ranga

    Ranganathan wrote:
    Hi All
    My requirement is like this, i receive a daily a file which are having transaction realted data,
    For ex: The first row will also have the transaction num and the second and third rows will be transaction realted infomation and in the 4th record i will have new transaction num and the following rows are realted to 2nd trans num details In the flat file i able to identify which record is transn num related data, now the issue will be the following will not have the transaction num informations, blindly 2 and 3 rows are having transaction num1 info only
    TRAN123
    'SALE'
    '450'
    TRAN245
    'SALE'
    '123'
    my output : TRAN123 is having a sale of 450 and TRAN245 is having a sale 123
    For this i need to read the data from the flat file by an order only
    Thanks
    RangaUTL_FILE
    but consider using EXTERNAL TABLE instead

  • Loading Flat files with into multiple tables using OWB

    Hi,
    How to implement the following logic in OWB.
    LOAD DATA
    INFILE 'myfile.txt'
    BADFILE 'myfile.bad'
    DISCARDFILE 'myfile.dsc'
    APPEND
    Into TABLE_Awhen (1:1) = 'A'
    (Col1 Position(1:1) CHAR,
    Col2 Position(2:5) CHAR)
    Into TABLE_Bwhen (1:1) = 'B'
    (Col1 Position(1:1) CHAR,
    Col2 Position(2:20) EXTERNAL INTEGER)
    Into TABLE_C
    when (1:1) = 'C'
    (Col1 Position(1:1) CHAR,
    Col2 Position(2:20) EXTERNAL INTEGER)
    I am using 10g version of OWB.I tried using the splitter operator.
    I am getting the following error when i use the splitter.
    An invalid combination of operators prevents the generation of code in a single implementation language (PL/SQL code, or SQL*Loader code, or ABAP code). For example, you may have included a SQL*Loader only operator such as the Data Generator in a mapping with a PL/SQL implementation type. If you designed the mapping to generate PL/SQL code, an invalid combination or sequence of operators prevents the generation of PL/SQL code in any of the operating modes(set based, row based, row based target only). If the mapping contains an operator that generates only PL/SQL output, all downstream dataflow operators must also be implementable by PL/SQL. You can use SQL operators in such a mapping only after loading the PL/SQL output to a target. Detail is as follows:
    PL/SQL set based operating mode: Operator trailer_source_txt does not support SQL generation.
    PL/SQL row based operating mode: Operator trailer_source_txt does not support SQL and PL/SQL generation.
    PL/SQL row based (target only) operating mode: Operator trailer_source_txt does not support SQL and PL/SQL generation.
    Both SQL and PL/SQL handlers are not supported by trailer_source_txt as output
    SQL*Loader: Operator SPLIT does not support SQL*Loader generation.
    ABAP: Operator trailer_source_txt does not support ABAP generation.
    Thanks in advance,
    VInay

    Hi
    Splitter can be used ib PL/SQL mappings, but if you use a flat file in a mapping, than it will be an SQLLoader mapping. So I suggest to you to create a mapping which load your flat file into a table, and from this table you load the data into the three table with the spillet in a PL/SQL mapping. Create two mappings.
    Or you can use an external table in a mapping with a splitter.
    Ott Karesz
    http://www.trendo-kft.hu

  • SQL*LOADER control file for Multiple Tables

    Dear DBA's
    I am loading data throgh SQL*LOADER in Oracle. I have some problem, While
    Inserting data into multiple table I have created single Control file in
    following way which is giving me error, Data is stored in seprate fileswith
    tablename.dat, So each tables data is stored in seprate .DAT file. So Iwant to
    insert data from single control file taking data from .dat multiple files into
    multiple tables. Is it possible?? or some different method
    Please help me as early as possiable.
    Thanks & Regards
    Shailesh
    CREATE TABLE T1 (
    L1 VARCHAR2(10),
    L2 NUMBER(10),
    L4 NUMBER(10),
    MYDATE DATE);
    CREATE TABLE T2 (
    L1 VARCHAR2(10),
    L2 NUMBER(10),
    L3 LONG,
    L4 NUMBER(10),
    MYDATE DATE)
    CONTROL FILE :-
    UNRECOVERABLE LOAD DATA
    INFILE 't2.dat'
    INSERT INTO TABLE t2
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    ( l1 char,l2 char,l4 char,mydate date,l3 char(2000000))
    INFILE 't1.dat'
    INSERT INTO TABLE t1
    FIELDS TERMINATED BY ','
    OPTIONALLYENCLOSED BY '"'
    TRAILING NULLCOLS
    ( f1 char,f2 char,f4 char))
    T2.DAT
    Raju,14,1,09-NOV-2000,"Has a powerful data parsing,engine which putslittle
    limitation on the format of the data in thedatafile."
    Manu,14,2,09-NOV-2000,"Can load data from multiple datafiles, during the same
    load session. "
    T1.DAT
    Raj,14,1,09-NOV-2000
    Mau,14,2,09-NOV-2000
    null

    Hi,
    I tried to use your control file and got numerous erros.
    try using seperate control files:
    T1.CTL:
    LOAD DATA
    INFILE 'D:\T2.dat'
    INSERT INTO TABLE t2
    ( l1 char,l2 char,l4 char,mydate date,l3 char(20000))
    T2.CTL
    LOAD DATA
    INFILE 'D:\T1.dat'
    INSERT INTO TABLE t1
    ( l1 char,l2 char,l4 char,mydate date)

Maybe you are looking for