How to write a procedure to load the data into a table using xml file as input to the procedure?

Hi,
Iam new to the xml,
can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>.
Regards,
vikram.

here is the your XML parse in 11g :
select *
  from xmltable('//Entity' passing xmltype
'<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>
') columns
  "dcode" varchar2(4000) path '/Entity/dcode',
  "ddesc" varchar2(4000) path '/Entity/ddesc',
  "reauthflag" varchar2(4000) path '/Entity/reauthflag'
dcode                                                                            ddesc                                                                            reauthflag
0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
0                                                                                (J04)Acute laryngitis and tracheitis                                             0
0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
SQL>
Using this parser you can create procedure as
SQL> create or replace procedure myXMLParse(x clob) as
  2  begin
  3    insert into MyXmlTable
  4      select *
  5        from xmltable('//Entity' passing xmltype(x) columns "dcode"
  6                      varchar2(4000) path '/Entity/dcode',
  7                      "ddesc" varchar2(4000) path '/Entity/ddesc',
  8                      "reauthflag" varchar2(4000) path '/Entity/reauthflag');
  9    commit;
10  end;
11 
12  /
Procedure created
SQL>
SQL>
SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
PL/SQL procedure successfully completed
SQL> select * from MYXMLTABLE;
dcode                                                                            ddesc                                                                            reauthflag
0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
0                                                                                (J04)Acute laryngitis and tracheitis                                             0
0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
SQL>
SQL>
Ramin Hashimzade

Similar Messages

  • How to delete the data in a table using function

    hi all,
    i need to delete the data in a table using four parameters in a function,
    the parameters are passed through shell script.
    How to write the function
    Thanks

    >
    But the only thing is that such function cannot be used in SQL.
    >
    Perhaps you weren't including the use of autonomous transactions?
    CREATE OR REPLACE FUNCTION remove_emp (employee_id NUMBER) RETURN NUMBER AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    tot_emps NUMBER;
    BEGIN
    SELECT COUNT(*) INTO TOT_EMPS FROM EMP3;
    DELETE FROM emp3
    WHERE empno = employee_id;
    COMMIT;
    tot_emps := tot_emps - 1;
    RETURN TOT_EMPS;
    END;
    SQL> SELECT REMOVE_EMP(7499) FROM DUAL;
    REMOVE_EMP(7499)
                  12
    SQL> SELECT REMOVE_EMP(7521) FROM DUAL;
    REMOVE_EMP(7521)
                  11
    SQL> SELECT REMOVE_EMP(7566) FROM DUAL;
    REMOVE_EMP(7566)
                  10
    SQL>

  • How to update the data in sqlserver table using procedure in biztalkserver

    Hi,
    Please can any one answer this below question
    how to update the data in sqlserver table using procedure in biztalkserver
    while am using executescalar,typedprocedure getting some warning
    Warning:The adapter failed to transmit message going to send port "SendtoSql1" with URL "mssql://nal126//MU_Stage2?". It will be retransmitted after the retry interval specified for this Send Port. Details
    Please send me asap....
    Thanks...

    Hi Messip,
    A detailed error would have helped us to answer you more appropriately but
    You can follow the post which has step by step instructions, to understand how to use Stored Procedure:
    http://tech-findings.blogspot.in/2013/07/insert-records-in-sql-server-using-wcf.html
    Maheshkumar
    S Tiwari|User
    Page|Blog|BizTalk
    2013: Inserting RawXML (Whole Incoming XML Message) in SQL database

  • How to load text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA,      IO TEST1,      IO TEST 1,        CHAR,         20
    ZIO_TEST2, CHA,      IO TEST2,      IO TEST 2,        CHAR,         20
    Regards,
    Mau

    Hi,
    U can use GUI_UPLOAD for this...
    Declare an internal table like
    data: begin of itab occurs 0,
    string(1200),
    end of itab.
    check the sample code:
    cange as you need
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: BEGIN OF ITAB occurs 0,
    TXT(1024),
    END OF ITAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = DATEI_PC
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = ITAB[]
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    NOT_SUPPORTED_BY_GUI = 17
    ERROR_NO_GUI = 18
    OTHERS = 19.
    IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
    WRITE: / 'UPLOAD:'.
    LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP.

  • Loading Text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA, IO TEST1, IO TEST 1, CHAR, 20
    ZIO_TEST2, CHA, IO TEST2, IO TEST 2, CHAR, 20
    Regards,
    Mau

    hi Mau,
    look this code, maybe it's help u.
    <b>REPORT  ZTXTTOTABLE.</b>
    DATA: p_file   TYPE string value 'C:\teste.txt',
          BEGIN OF TI_table OCCURS 0,
            COD(5) TYPE C,
            NAME(40),
          END OF TI_table,
          a(2).
    PARAMETERS: sel_file(128) TYPE c
                default 'C:\teste.txt' OBLIGATORY LOWER CASE.
    p_file = sel_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = p_file
      TABLES
        data_tab = ti_table[].
    format color COL_TOTAL INTENSIFIED ON.
    loop at ti_table.
      write: / sy-vline, ti_table-cod, at 10 sy-vline, ti_table-name,
             at 60 sy-vline.
    endloop.
    write: / sy-uline(60).
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ''
          def_path         = 'C:\'
          mask             = ',Documentos de texto (*.txt), *.txt.'
          mode             = ''
        IMPORTING
          filename         = p_file
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      find '.txt' IN p_file.
      if sy-subrc <> 0.
        concatenate p_file '.txt' into sel_file.
      else.
        sel_file = p_file.
      endif.
    top-of-page.
      format color COL_HEADING INTENSIFIED ON.
      uline (60).
      write: / sy-vline, 'COD', at 10 sy-vline, 'NAME', at 60 sy-vline.
      write: / sy-uline(60).
    good luck!
    Regards
    Allan Cristian

  • Insert the data into two tables at a time.

    Hi ,
    i have these two tables
    create table [dbo].[test1](
    [test1_id] [int] identity(1,1) primary key,
    [test2_id] [int] not null
    create table [dbo].[test2](
    [test2_id] [int] identity(1,1) primary key,
    [test1_id] [int] not null
    alter table [dbo].[test1]
    add constraint [fk_test1_test2_id] foreign key([test2_id])
    references [dbo].[test2] ([test2_id])
    alter table [dbo].[test2] add constraint [fk_test2_test2_id] foreign key([test1_id])
    references [dbo].[test1] ([test1_id])
    I want to insert the data into two tables in one insert statement. How can i do this using T-SQL ?
    Thanks in advance.

    You can INSERT into both tables within one Transaction but not in one statement. By the way, you would need to alter your dbo.Test1 table to allow null for first INSERT test2_id column
    See sample code below:
    CREATE TABLE #test1(test1_ID INT IDENTITY(1,1),test2_id INT NULL)
    CREATE TABLE #test2(test2_ID INT IDENTITY(1,1),test1_ID INT)
    DECLARE @Test1dentity INT
    DECLARE @Test2dentity INT
    BEGIN TRAN
    -- Insert NULL as test2_ID value is unknown
    INSERT INTO #test1(test2_ID)
    SELECT NULL;
    -- get inserted identity value
    SET @Test1dentity = SCOPE_IDENTITY();
    INSERT INTO #test2(test1_ID)
    SELECT @Test1dentity;
    -- get inserted identity value
    SET @Test2dentity = SCOPE_IDENTITY();
    -- Update test1 table
    UPDATE #test1
    SET test2_ID = @Test2dentity
    WHERE test1_ID = @Test1dentity;
    COMMIT
    SELECT * FROM #test1;
    SELECT * FROM #test2;
    -- Drop temp tables
    IF OBJECT_ID('tempdb..#test1') IS NOT NULL
    BEGIN
    DROP TABLE #test1
    END
    IF OBJECT_ID('tempdb..#test2') IS NOT NULL
    BEGIN
    DROP TABLE #test2
    END
    web: www.ronnierahman.com

  • I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    You only need the ODBC driver on each computer. If you are distributing the SQL Toolkit app as an executable and do not install the whole toolkit on each computer, you'll need the SQL Toolkit support files. This is about a dozen files. You can get the list at http://digital.ni.com/public.nsf/websearch/b814be005f9da9258625658700550c75?OpenDocument.

  • How to maintain the data  into database table

    Hi,
    experts,
    how to maintain the data  into database table

    There are several ways to maintain data in the database
    1. Use table maintanance generator . You can create this using SE11 and data can be edited through SM30.
    2. Loginto  SE11 with the specified table and check the ATTRIBUTES tab. There you can set some parameters for maintaining the database. When you set Maintain database, you edit the data thorugh SE11 it self
    3. Through Se16 as well.
    4. A small abap program can do the above task as well.
    Thanks,
    Raj
    Edited by: Rajanya Kolavennu on Feb 5, 2008 8:33 PM

  • Load Huge data into oracle table

    Hi,
    I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
    Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
    How to do the mass upload of data into oracle table need experts suggestion on this requirement.
    Thanks
    Sudhir

    Sudhir_Meru wrote:
    Hi,
    I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
    Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
    How to do the mass upload of data into oracle table need experts suggestion on this requirement.
    Thanks
    SudhirOne method is to use SQL Loader (sqlldr)
    Another method is to define an external table in Oracle which is allowing you to view your big file as a table in database.
    You may want to have a look at this guide: Choosing the Right Export/Import Utility and this Managing External Tables.
    Regards.
    Al
    Edited by: Alberto Faenza on Nov 6, 2012 10:24 AM

  • How to  load data into user tables using DIAPIs?

    Hi,
    I have created an user table using UserTablesMD object.
    But I don't have know how to load data into this user table. I guess I have to use UserTable object for that. But I still don't know how to put some data in particular column.
    Can somebody please help me with this?
    I would appreciate if somebody can share their code in this regard.
    Thank you,
    Sudha

    You can try this code:
    Dim lRetCode As Long
    Dim userTable As SAPbobsCOM.UserTable
    userTable = pCompany.UserTables.Item("My_Table")
    'First row in the @My_Table table
    userTable.Code = "A1"
    userTable.Name = "A.1"
    userTable.UserFields.Fields.Item("U_1stF").Value = "First row value"
    userTable.Add()
    'Second row in the @My_Table table
    userTable.Code = "A2"
    userTable.Name = "A.2"
    userTable.UserFields.Fields.Item("U_1stF").Value = "Second row value"
    userTable.Add()
    This way I have added 2 lines in my table.
    Hope it helps
    Trinidad.

  • Want to load excel data into oracle table with out changing it to CSV

    Hello all,
    I have a requirement in dumping excel data into oracle database table without changing it to CSV file and this has to be used in normal sql/plsql environment i.e., pkg/procedure cant be used in the forms also...
    so, can u guys can help me out in this
    thanks.............

    The link Pavan provided discusses Oracle Heterogeneous Services. This allows you (using ODBC) to create a database link from Oracle to a non-Oracle data source like Excel. This would allow you to query the Excel data source from SQL*Plus or any other client tool. But that is probably going to require that your Oracle database is running on Windows since I'm not aware of any Excel ODBC drivers for Unix.
    Another potential option would be to write a Java stored procedure that parsed the file. There are a few different Java libraries that can read and write Excel data files. You could load one of those libraries into the database's JVM and then write Java code that parsed the file. You would then be able to call your Java stored procedure from PL/SQL.
    Justin

  • Problem to upload the data into internal table record length more than 6000

    Hi all
            I stuck with this problem from past 3 days. I have to upload the data from excel sheet. iam making it tab delimited and trying to upload from gui_upload. but in the structure of file, we have, one field of 4000 characters, and other fields of 255 characters.
    how can i upload this into internal table . From excel sheet or from tab delimeted or any other format? or any special function module is there?  while iam doing this its truncating the datat 255 characters and not uploading the other fields also...
    can any one of you help me out. ASAP
    thnks in advance

    from one of the forum iam just pasting code which it is used in lsmw, try the same logic in ur code hope it can work.
    you have to create multiple lines with do...enddo loop., like this:
    (assuming excel_long_text-text is 924 characters long, 7 lines X 132 char)
    __GLOBAL_DATA__
    data: offset type i,
    text_132(132) type c.
    __BEGIN_OF_RECORD__ Before Using Conversion Rules
    Rule : Default Settings Modified
    Code: /sapdmc/ltxtl = init_/sapdmc/ltxtl.
    CLEAR offset.
    DO 7 TIMES.
    text_132 = excel_long_text-text+offset(132).
    offset = offset + 132.
    __END_OF_RECORD__ After Using Conversion Rules
    Rule : Default Settings Modified
    Code: transfer_record.
    ENDDO.
    also check this
    COMMIT_TEXT
    To load long text into SAP
    READ_TEXT
    To load long text into SAP

  • Error 'Loading Textfile data into external table'

    I am using Apex 2.0, Oralce Database 10G and Internet Explorer (version 6.5)
    I tried to run following code using SQLCommands of SQLWORKSHOP of Apex
    Code Here:
    declare
    ddl1 varchar2(200);
    ddl2 varchar2(4000);
    begin
    ddl1 := 'create or replace directory data_dir as
    ''C:\LAUSD_DATA\''';
    execute immediate ddl1;
    ddl2:= 'create table tbl_temp_autoload
    (ID NUMBER,
         RECTYPE VARCHAR2(2),
         EXPORTNBR NUMBER(2),
         EXPORTDATE DATE,
         BIMAGEID VARCHAR2(11),
         APPLICNBR NUMBER(10),
         MEALIMAGE VARCHAR2(17),
         MEDIIMAGE VARCHAR2(17),
         LANGUAGE VARCHAR2(1),
         APPLICCNT NUMBER(1),
         OTHAPPLICNBR VARCHAR2(10),
         PEDETDATE DATE,
         PESTATUS VARCHAR2(1),
         ERRORREMARKS VARCHAR2(50),
         COMMENTS VARCHAR2(50),
         SID1 VARCHAR2(10),
         WID1 NUMBER(10),
         MEDIROW1 VARCHAR2(1),
         LASTNAME1 VARCHAR2(20),
         FIRSTNAME1 VARCHAR2(20),
         SCHOOL1 VARCHAR2(15),
         LOCCD1 VARCHAR2(4),
         BIRTHDATE1 DATE,
         CASENBR1 VARCHAR2(15),
         FOSTER1 VARCHAR2(1),
         CHILDINC1 VARCHAR2(4),
         RACEAIAN VARCHAR2(1),
         RACEBAA VARCHAR2(1),
         RACENHPI VARCHAR2(1),
         RACEASIAN VARCHAR2(1),
         RACEWHITE VARCHAR2(1),
         HISPANIC VARCHAR2(1),
         NOTHISPANIC VARCHAR2(1),
         ADULTSIG3 VARCHAR2(1),
         ADULTSIGDATE3 VARCHAR2(10),
         ADULTNAME3 VARCHAR2(30),
         SSN3 VARCHAR2(1),
         SSN3NOT VARCHAR2(1),
         ADDRESS VARCHAR2(30),
         APTNBR VARCHAR2(6),
         CTY VARCHAR2(20),
         ZIP NUMBER(5),
         PHONEHOME VARCHAR2(12),
         PHONEWORK VARCHAR2(12),
         PHONEEXTEN VARCHAR2(6),
         MEALROWA VARCHAR2(1),
         LNAMEA VARCHAR2(20),
         FNAMEA VARCHAR2(20),
         MINITA VARCHAR2(6),
         GENDERA VARCHAR2(1),
         AGEA NUMBER(2),
         MOTYPEA VARCHAR2(1),
         MONAMEA VARCHAR2(1),
         FATYPEA VARCHAR2(1),
         FANAMEA VARCHAR2(1),
         FAMNBR NUMBER(1),
         PARENTINC NUMBER(5),
         FAMILYINC NUMBER(5),
         FAMILYSIZE NUMBER(2),
         PGSIG1 VARCHAR2(1),
         PGNAME1 VARCHAR2(30),
         PGSIGDATE1 VARCHAR2(10),
         FAMSIZE1 VARCHAR2(2),
         FAMINC1 VARCHAR2(6),
         PGSIG2 VARCHAR2(1),
         PGNAME2 VARCHAR2(30),
         PGSIGDATE2 DATE,
         FAMSIZE2 VARCHAR2(2),
         FAMINC2 VARCHAR2(4),
         GRADE NUMBER(2),
         SCHOOL VARCHAR2(40),
         RACE VARCHAR2(4),
         MEDI_CALID VARCHAR2(15),
         MEDSTATUS VARCHAR2(1),
         ADULT1NAME VARCHAR2(40),
         ADULT1TYPE VARCHAR2(1),
         ADULT1INC1 VARCHAR2(5),
         ADULT1INC2 VARCHAR2(5),
         ADULT1INC3 VARCHAR2(5),
         ADULT1INC4 VARCHAR2(5),
         ADULT2NAME VARCHAR2(40),
         ADULT2TYPE VARCHAR2(1),
         ADULT2INC1 VARCHAR2(5),
         ADULT2INC2 VARCHAR2(5),
         ADULT2INC3 VARCHAR2(5),
         ADULT2INC4 VARCHAR2(5),
         ADULT3NAME VARCHAR2(40),
         ADULT3TYPE VARCHAR2(1),
         ADULT3INC1 VARCHAR2(5),
         ADULT3INC2 VARCHAR2(5),
         ADULT3INC3 VARCHAR2(5),
         ADULT3INC4 VARCHAR2(5),
         ADULT4NAME VARCHAR2(40),
         ADULT4TYPE VARCHAR2(1),
         ADULT4INC1 VARCHAR2(5),
         ADULT4INC2 VARCHAR2(5),
         ADULT4INC3 VARCHAR2(5),
         ADULT4INC4 VARCHAR2(5),
         ADULT5NAME VARCHAR2(40),
         ADULT5TYPE VARCHAR2(1),
         ADULT5INC1 VARCHAR2(5),
         ADULT5INC2 VARCHAR2(5),
         ADULT5INC3 VARCHAR2(5),
         ADULT5INC4 VARCHAR2(5),
         ADULT6NAME VARCHAR2(40),
         ADULT6TYPE VARCHAR2(1),
         ADULT6INC1 VARCHAR2(5),
         ADULT6INC2 VARCHAR2(5),
         ADULT6INC3 VARCHAR2(5),
         ADULT6INC4 VARCHAR2(5),
         AGE1LT19 VARCHAR2(1),
         AGE2LT19 VARCHAR2(1),
         AGE3LT19 VARCHAR2(1),
         AGE4LT19 VARCHAR2(1),
         AGE5LT19 VARCHAR2(1),
         AGE6LT19 VARCHAR2(1),
         MIDINIT1 VARCHAR2(1)
    organization external
    ( type oracle_loader
    default directory data_dir
    access parameters
    ( fields terminated by '','' )
    location (''DataJuly07.txt'')
    execute immediate ddl2;
    end;
    Error Received:
    ORA-29913:error in executing ODCIEXITTABLEFETCH callout ORA-30653: reject limit reached
    Please help ASAP. I am new with oracle and Apex. Any help will be appreciated greatly.

    I downloaded the External table simple application from the Apex Packaged application and installed it. It installed successfully but when I run it - it doesn't load the data eventhough I get a message stating it was successful. I am running it on OracleXE - Apex 3.0.1.
    In addition, I tried running the stored procedure directly (ext_employees_load) in sql-developer and received the ora-30648.
    Please help.
    thanks,
    Tom

  • Error in loading data into essbase while using Rule file through ODI

    Hi Experts,
    Refering my previous post Error while using Rule file in loading data into Essbase through ODI
    I am facing problem while loading data into Essbase. I am able to load data into Essbase successfully. But when i used Rule file to add values to existing values I am getting error.
    test is my Rule file.
    com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: Cannot put olap file object. Essbase Error(1053025): Object [test] already exists and is not locked by user [admin@Native Directory]
    at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
    at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:346)
    at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2458)
    at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:48)
    at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:540)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
    at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
    at java.lang.Thread.run(Thread.java:662)
    from com.hyperion.odi.common import ODIConstants
    from com.hyperion.odi.connection import HypAppConnectionFactory
    from java.lang import Class
    from java.lang import Boolean
    from java.sql import *
    from java.util import HashMap
    # Get the select statement on the staging area:
    sql= """select C1_HSP_RATES "HSP_Rates",C2_ACCOUNT "Account",C3_PERIOD "Period",C4_YEAR "Year",C5_SCENARIO "Scenario",C6_VERSION "Version",C7_CURRENCY "Currency",C8_ENTITY "Entity",C9_VERTICAL "Vertical",C10_HORIZONTAL "Horizontal",C11_SALES_HIERARICHY "Sales Hierarchy",C12_DATA "Data" from PLANAPP."C$_0HexaApp_PLData" where (1=1) """
    srcCx = odiRef.getJDBCConnection("SRC")
    stmt = srcCx.createStatement()
    srcFetchSize=30
    #stmt.setFetchSize(srcFetchSize)
    stmt.setFetchSize(1)
    print "executing query"
    rs = stmt.executeQuery(sql)
    print "done executing query"
    #load the data
    print "loading data"
    stats = pWriter.loadData(rs)
    print "done loading data"
    #close the database result set, connection
    rs.close()
    stmt.close()
    Please help me on this...
    Thanks & Regards,
    Chinnu

    Hi Priya,
    Thanks for giving reply. I already checked that no lock are available for rule file. I don't know what's the problem. It is working fine without the Rule file, but throwing error only when using rule file.
    Please help on this.
    Thanks,
    Chinnu

  • Loading data into multiple tables using sqlloader

    Hi,
    I am using sql loader to load the data from flat file into the data base
    my file structure is as below
    ====================
    101,john,mobile@@fax@@home@@office@@email,1234@@3425@@1232@@2345@@[email protected],1234.40
    102,smith,mobile@@fax@@home,1234@@345@@234,123.40
    103,adams,fax@@mobile@@office@@others,1234@@1233@@1234@@3456,2345.40
    in file first columns are empno,ename,comm_mode(multiple values terminated by '@@'),comm_no_txt(multiple values terminated by '@@'), sal
    the comm_mode and comm_no_text needs to be inserted into the separate table (emp_comm) like below
    emp
    empno ename sal
    101 john 1234.40
    102 smith 123.40
    103 adams 2345.40
    emp_comm
    empno comm_mode comm_no_text
    101 mobile 1234
    101 fax 3425
    101 home 1232
    101 office 2345
    101 email [email protected]
    102 mobile 1234
    102 fax 345
    102 home 234
    103 fax 1234
    like this needs to insert the data using sql loader
    my table structures
    ===============
    emp
    empno number(5)
    ename varchar2(15)
    sal number(10,2)
    emp_comm
    empno number(5) reference the empno of the emp table
    comm_mode varchar2(10)
    Comm_no_text varchar2(35)
    now i want insert the file data into the specified structues
    please help me out to achieve this using sql loader
    (we are not using external tables for this)
    Thanks & Regards.
    Bala Sake
    Edited by: 954925 on Aug 25, 2012 12:24 AM

    Pl post OS and database details
    You will need to split up the datafile in order to load into separate tables. The process is documented
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm#autoId72
    HTH
    Srini

Maybe you are looking for