How to store Multiple Ec\xcels into Table Using sql loder

Plese guide me to store Multiple Ec\xcels into Table Using sql loder

I am not clear with your question. Do you want to load multipel Excel Files into a table. If so you can follow this link.
http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F
Thanks,
Karthick.

Similar Messages

  • How to Load Multiple Files in Oracle Database using Sql Loader

    Hi All,
    I want to import multiple files in my DB using Sql*Loader. Please tell me the Syntax, how can I import multiple files using one Control File?
    Thanks & Regards,
    Imran

    Hi,
    You might get a good response to your post in the forum dedicated to data movement , including SQL*Loader . You can find it here Export/Import/SQL Loader & External Tables
    Regards,

  • How to Store an XML Data into Table?

    Hi All,
    My Requirement is "I Have an XML File (or) XML Data as CLOB, now I should decode this XML Data and find the equivalent data for columns in a table and then store that in a relational table",
    Would be greatful if any one can provide me a feasible solution (or) good link where I can get this information with examples.
    Thanks in advance,
    Sunil N

    Or,
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>
    satyaki>drop table dump_tab;
    Table dropped.
    Elapsed: 00:00:01.08
    satyaki>
    satyaki>create table dump_tab
      2   (
      3      raw_xml  clob
      4   );
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>desc dump_tab;
    Name                                      Null?    Type
    RAW_XML                                            CLOB
    satyaki>
    satyaki>
    satyaki>insert into dump_tab
      2  select yy.rxml
      3  from (
      4        select ('  <data>
      5           <var name="document">
      6           <string>Sales Order</string>
      7           </var>
      8           <var name="results">
      9           <recordset rowcount="2">
    10           <field name="sales_num">
    11           <string>12345</string>
    12           <string>60192</string>
    13           </field>
    14           <field name="ord_qty">
    15           <string>10</string>
    16           <string>50</string>
    17           </field>
    18           </recordset>
    19           </var>
    20           </data>'
    21      ) rxml from dual
    22     ) yy;
    1 row created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create table results
      2    (
      3      serial_no    number(5),
      4      sales_num    number(7),
      5      ord_qty      number(10)
      6    );
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>desc results;
    Name                                      Null?    Type
    SERIAL_NO                                          NUMBER(5)
    SALES_NUM                                          NUMBER(7)
    ORD_QTY                                            NUMBER(10)
    satyaki>
    satyaki>select * from dump_tab;
    RAW_XML
      <data>
             <var name="document">
             <string>Sales Order</string>
             </var>
             <var name="results">
             <recordset rowcount="2">
             <field name="sales_num">
             <string>12345</string>
             <string>60192</string>
             </field>
             <field name="ord_qty">
    RAW_XML
             <string>10</string>
             <string>50</string>
             </field>
             </recordset>
             </var>
             </data>
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  insert into results(serial_no,sales_num,ord_qty)
      2  with t
      3    as (
      4         select xmltype(raw_xml) xml from dump_tab
      5       ),
      6    t1 as (select rownum rn, t1.column_value.extract('*/text()') sales_num from t t, table(xmlsequence(t.xml.extract('//field[@name="sales_num"]/string'))) t1),
      7    t2 as (select rownum rn, t2.column_value.extract('*/text()') ord_qty   from t t, table(xmlsequence(t.xml.extract('//field[@name="ord_qty"]/string'))) t2)
      8    select t1.rn x,
      9           to_number(regexp_replace(xmlelement("e",sales_num).getstringval(),'<(|/)e>','')) sales_num
    10           to_number(regexp_replace(xmlelement("d",ord_qty).getstringval(),'<(|/)d>','')) ord_qty
    11      from t1,t2
    12*    where t1.rn = t2.rn
    satyaki>/
    2 rows created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from results;
    SERIAL_NO  SALES_NUM    ORD_QTY
             1      12345         10
             2      60192         50
    Elapsed: 00:00:00.00
    satyaki>Regards.
    Satyaki De.

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • How to Query Multiple Fields from different Tables using Toplink Expression

    Hi,
    I am trying to prepare an Oracle Toplink Expression to qurey the multiple columns of different tables. the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to readAllObjects method as a parameter
    Expression exp = (..............this is the required qurey expression...................)
    Vector employees = session.readAllObjects(getClass(), exp);
    thanks,

    You havent given any information on the mapping between Cycle and Asp. I presume there is a one to one mapping between them. Also it appears there is no "WHERE" clause to limit the number of cycles being retrieved. If that is the case then I presume you want to load all cycles in the system.
    Thats just a clientSession.readAllObjects(Cycle.class). If you have indirection turned on the Asp should get loaded when you do a cycle.getAsp().
    I presume that SQL you posted loads all the columns of CYCLE and ASP. If you are interested in a subset of CYCLE or ASP then you should do a ReportQuery or partial object read.
    Hi,
    I am trying to prepare an Oracle Toplink Expression
    to qurey the multiple columns of different tables.
    the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME
    LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to
    readAllObjects method as a parameter
    Expression exp = (..............this is the required
    qurey expression...................)
    Vector employees = session.readAllObjects(getClass(),
    exp);
    thanks,

  • Upload multiple excel files into tables using APEX

    Hi folks,
    I'm wondering if anyone has ever uploaded multiple .csv files simultaniously and store the data into the database using APEX XE before.
    I can browse for a single file, and execute that okay and a good example of doing that can be found at http://advait.wordpress.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    This works fine when the user browses to a specific file on their network and then uploads the data from that one file.
    However I need the ability to 'grab' every file in a specific directory one after the other to process rather than having to specify which one to load everytime, and wondered if anyone has come across this before.
    Many thanks
    Graham.

    Just for completeness ...
    Got this to work, but it's a pl/sql issue as opposed to an APEX issue.
    Anyway, if anyone needs to have the ability to read multiple files then a quick easy way to do it (as lomg as they know the file names that will be read), is to create a directory on the database which points to the actual harddrive on your PC, then create a table (called an external table) and read from that external table as if it was an actual database table ...
    1 - Log on as sys and grant CREATE ANY DIRECTORY to whatever user you are logging in as (assuming you are not using sys to create apps)
    2 - Create a directory e.g....CREATE OR REPLACE DIRECTORY GB_TEST AS 'c:\gbtest';
    3 - Create an external table as ...
    CREATE TABLE gb_test
    (file_name varchar2(10),
    rec_date date
    rec_name VARCHAR2(20),
    rec_age number,
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY GB_TEST
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
    PARALLEL 5
    REJECT LIMIT 20000;
    That's it then ...
    select * from gb_test
    where file_name = 'xxx'
    will return all the data where the file_name = 'xxx'
    very easy to use.

  • How to update multiple records in the table using POST parameters:

    i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
    The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
    I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
    will not work in the update code section:
    for($i=0;$i<$maxRows_Recordset1;$i++)
    {$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
    $b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
    $display_order .= array(
        $a => $b
    if($i<$maxRows_Recordset1-1)
    $ids = implode(',', array_keys($display_order));
    $updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
    foreach ($display_order as $a => $b) {
        $updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
    $updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to update multiple records in a table using procedure?

    Dear All,
    1 am using 11.1.2.1.0
    my question is i have a table like
    emp id(primary key), empname,location
    1                             damby      blore
    2                             rocky       kormangala
    3                              biswa     india
    my question  is i need to write one procure that at a time i can update empname and location(wat the value are there in empname and location i  need to change at a time).
    thanks
    Damby

    Hi, Damby,
    That sounds like what the UPDATE statement does, exactly.  Just use an UPDATE statement to change any number of columns in existing rows.  You don't need a procedure, but, if you're using a procedure for some other reason, you can do the UPDATE in the procedure.  UPDATE works the same in SQL or PL/SQL.
    Sometimes MERGE is more convenient than UPDATE.  Like UPDATE, it can change any number of columns, either in SQL or PL/SQL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to update multiple records in custom table using checkbox in APEX 4.1?

    Hi,
    I have a SQL report which brings up all the data records using the following query.
    select
    "REC_NO" AS hidden_rec_no,
    "REC_NO",
    APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
    "MEETING_TYPE",
    "PAGE_NO",
    "CHECKBOX"
    from "XX_TEST" m
    WHERE page_no = :p_page_no
    Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
    DECLARE.
    l_row NUMBER := 1;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
    LOOP
    FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
    LOOP
    IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
    UPDATE xx_test
    SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
    WHERE rec_no = APEX_APPLICATION.G_F03(i);
    l_row := j + 1;
    EXIT;
    END IF;
    END LOOP;
    END LOOP;
    COMMIT;
    END;
    However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
    Regards.

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • How can I group student scores into quintile using SQL Server 2008

    Can anyone help me to group student scores into quintile. I think there is a feature in SQL Server 2012, but still we are have not upgrade to it as we are using 2008R2. I tried Ntile(5) but it not generating the desired result. I need below Quintile column
    Student Score Quintile
    Student1 20 1
    Student2 20 1
    Student3 30 2
    Student4 30 2
    Student5 40 2
    Student6 40 2
    Student7 50 3
    Student8 50 3
    Student9 60 3
    Student10 70 4
    Student11 70 4
    Student12 80 4
    Student13 80 4
    Student14 90 5

    Please try to get ranking for below data
    HI , I need a dynamic SQL which would handle few hundred records and scores may vary..Sometime it may be small test marks ranging from 5 to 25 sometimes it may be out of 100. 
    I tried for larger data set. It
    failed. It is not at all showing Rank 3.Since it not falling in the comparison Below are the 99 records.
    Student
    Name  -> Score
    Student
    1 to 5 -> 4
    Student
    7 to 26 -> 5
    Student
    27 to 71 -> 6
    Student
    72 to 98 -> 7
    Student
    99 -> 9

  • How to delete a single data from table using control file

    I want delete a single row data from table using sql loder control file
    Edited by: 977940 on Dec 19, 2012 9:00 PM

    977940 wrote:
    I want delete a single row data from table using sql loder control file
    Edited by: 977940 on Dec 19, 2012 9:00 PMWhy?
    And how do you imagine this happening with sqlloader?
    The entire purpose of sqlloader is to load data (hence, the name sql*loader*) into a table from an external source. If you want to delete rows from a table, you use the sql DELETE statement.
    What is the business problem you are trying to solve?

  • Insert data file name into table from sql loader

    Hi All,
    I have a requirement to insert the data file name dynamically into table using sql loader.
    Example:
    sqlldr userid=username/passwword@host_string control=test_ctl.ctl data=test_data.dat
    test_ctl.ctl
    LOAD DATA
    FILED TERMINATED BY ','
    INTO TABLE test
    (empid number,
    ename varchar2(20),
    file_name varchar2(20) ---------- This should be the data file name which can be dynamic (coming from parameter)
    test_data.dat
    1,test
    2,hello
    3,world
    4,end
    Please help..
    Thanks in advance.
    Regards
    Anuj

    you'll probably have to write your control file on the fly, using a .bat or .sh file
    rem ===== file : test.bat ========
    rem
    rem ============== in pseudo speak =============
    rem
    rem
    echo LOAD DATA > test.ctl
    echo FILED TERMINATED BY ',' >> test.ctl
    echo INTO TABLE test >> test.ctl
    echo (empid number, >> test.ctl
    echo ename varchar2(20), >> test.ctl
    echo file_name constant %1% >> test.ctl
    echo ) >> test.ctl
    rem
    rem
    rem
    sqlldr userid=username/passwword@host_string control=test.ctl data=test_data.dat
    rem =============== end of file test.bat =======================
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1008664

  • How to store array of data into a single row of  table ,using any of Stmts

    HI Friends,
    Based on my requirements ,i have retrived a set of data from a XXX.jsp page using a request.getParameter() and stored into single dimenssional array . Now i am paassing that array to JAVA class to store a into some table .
    In JSP page users can add text boxes dynamically based on his intrest then those attributes will store in table .it means table attributes are not conatant , it table attributes may change at any time when user adds any textboxs or any fields on JSP page ....thats my module ..
    Now i wanted to store all array of data into Table in a single row .......thats is my requirements .
    How can we use prepareStatement and Statement to store array of results intoo table row ...on each iteration i wanted to store array of results into table atributes ..It means entire array of results should to into table row at time .....coule any one write sytax ,how we do this...
    could any one suggest me stps that i can impliment ......?....please reply ASAP

    Well ..you code can be works for constant number of attributes in table .oopss here my requirement is table attributes not fixed ,we cant put constant number of place holder(? ) in a statement ,because those are not fixed ,
    Let me explain here :
    i am doing in that way only. As i mentioned you Table attributes are not constant .It may very if users add any fields dynamically on JSP page .If users have option to add any text box on Jsp page ,then that attribute will store in table as a attribute .
    Now i amable fetching the all dyamic form data and stored in a Result Array below ...in this iteration all form result data are from jsp page as suggestion form ,it should stored in table in single row on corrsponding attribtes ......next time when users fills FROM ,then those data i am fetching and storing in a Result Array as below and need to store in corrsponding table attributes in a single row ....
    for(int i=0;i<result.length;i++)
                   System.out.println(result);
                   pst3=connection.prepareStatement("insert into *emprecord* values(?)");
                   if(!result[i].equals(""))
                        System.out.println(result[i]);
                             pst3.setString(1,result[i]);
                             pst3.executeUpdate();
    Thnks in advance ....let me know the the way we can store dynamic form data into dyanamic table ...

  • How to store output of SQ01 into internal table.

    Hello Experts
    How to store output of SQ01 into internal table.
    Thanks,
    Umesh

    You can't store the sq01 output into internal table.
    Once you create the query it will generate the abap program, in that program you can see the contents.
    Regards
    Sasi

Maybe you are looking for