SQL insert scripts generation from repository data xml file

Hi All,
I want to generate sql insert scripts from repository data xml file which contain <add-item>elements.
Example: data xml file is contains
<add-item item-descriptor="user" id="741">
<set-property name="gender"><![CDATA[female]]></set-property>
<set-property name="emailStatus"><![CDATA[__NULL__]]></set-property>
<set-property name="receiveEmail"><![CDATA[__NULL__]]></set-property>
<set-property name="email"><![CDATA[[email protected]]]></set-property>
<set-property name="password"><![CDATA[a694cb1d6d011eddc444acb77338c1df6a22bac5de26330e2fe1d20f15f97ed6]]></set-property>
<!-- rdonly derived <set-property name="abandonedOrderCount"><![CDATA[0]]></set-property> -->
<set-property name="locale"><![CDATA[de_DE]]></set-property>
<set-property name="userType"><![CDATA[1]]></set-property>
<set-property name="autoLogin"><![CDATA[__NULL__]]></set-property>
<set-property name="lastName"><![CDATA[Springford]]></set-property>
<set-property name="member"><![CDATA[true]]></set-property>
<set-property name="dateOfBirth"><![CDATA[7/18/1951 00:00:00]]></set-property>
<!-- rdonly derived <set-property name="age"><![CDATA[61]]></set-property> -->
<set-property name="registrationDate"><![CDATA[5/16/1996 00:00:00]]></set-property>
<set-property name="login"><![CDATA[sally]]></set-property>
<set-property name="lastActivity"><![CDATA[6/9/1999 00:00:00]]></set-property>
<set-property name="homeAddress"><![CDATA[741]]></set-property>
<set-property name="passwordSalt"><![CDATA[sally]]></set-property>
<set-property name="generatedPassword"><![CDATA[__NULL__]]></set-property>
<set-property name="firstName"><![CDATA[Sally]]></set-property>
<set-property name="lastPasswordUpdate"><![CDATA[__NULL__]]></set-property>
</add-item>
Thanks
Siva

HI Rohan,
Thanks for reply..
I have checked the startSQLRepository script by using this we can export or import repository data from xml to repository.But in startSQLRepository there is no attribute to generate sql
insert scripts from data xmls but there is a option to get the sql scripts(-ouputSQL).

Similar Messages

  • How to generate the insert script of the  tables data present  in an entire

    How to generate the insert script of the tables data present in an entire schema in sqlplus environment
    with out toad can you please help me please!!!!!!!!!!!!!

    HI,
    First create this function to get insert scripts.
    /* Formatted on 2012/01/16 10:41 (Formatter Plus v4.8.8) */
    CREATE OR REPLACE FUNCTION extractdata (v_table_name VARCHAR2)
       RETURN VARCHAR2
    AS
       b_found   BOOLEAN         := FALSE;
       v_tempa   VARCHAR2 (8000);
       v_tempb   VARCHAR2 (8000);
       v_tempc   VARCHAR2 (255);
    BEGIN
       FOR tab_rec IN (SELECT table_name
                         FROM user_tables
                        WHERE table_name = UPPER (v_table_name))
       LOOP
          b_found := TRUE;
          v_tempa := 'select ''insert into ' || tab_rec.table_name || ' (';
          FOR col_rec IN (SELECT   *
                              FROM user_tab_columns
                             WHERE table_name = tab_rec.table_name
                          ORDER BY column_id)
          LOOP
             IF col_rec.column_id = 1
             THEN
                v_tempa := v_tempa || '''||chr(10)||''';
             ELSE
                v_tempa := v_tempa || ',''||chr(10)||''';
                v_tempb := v_tempb || ',''||chr(10)||''';
             END IF;
             v_tempa := v_tempa || col_rec.column_name;
             IF INSTR (col_rec.data_type, 'CHAR') > 0
             THEN
                v_tempc := '''''''''||' || col_rec.column_name || '||''''''''';
             ELSIF INSTR (col_rec.data_type, 'DATE') > 0
             THEN
                v_tempc :=
                      '''to_date(''''''||to_char('
                   || col_rec.column_name
                   || ',''mm/dd/yyyy hh24:mi'')||'''''',''''mm/dd/yyyy hh24:mi'''')''';
             ELSE
                v_tempc := col_rec.column_name;
             END IF;
             v_tempb :=
                   v_tempb
                || '''||decode('
                || col_rec.column_name
                || ',Null,''Null'','
                || v_tempc
                || ')||''';
          END LOOP;
          v_tempa :=
                v_tempa
             || ') values ('
             || v_tempb
             || ');'' from '
             || tab_rec.table_name
             || ';';
       END LOOP;
       IF NOT b_found
       THEN
          v_tempa := '-- Table ' || v_table_name || ' not found';
       ELSE
          v_tempa := v_tempa || CHR (10) || 'select ''-- commit;'' from dual;';
       END IF;
       RETURN v_tempa;
    END;
    SET PAUSE OFF
    SET LINESIZE 1200
    SET PAGESIZE 100
    SET TERMOUT OFF
    SET HEAD OFF
    SET FEED OFF
    SET ECHO OFF
    SET VERIFY OFF
    SPOOL  GET_INSERTS.SP REP
    SELECT EXTRACTDATA('EMP') FROM DUAL;
    SPOOL OFF
    SET PAUSE  ON
    SET LINESIZE 120
    SET PAGESIZE 14
    SET TERMOUT ON
    SET HEAD ON
    SET FEED 5
    SET ECHO ON
    SET VERIFY ON
    SELECT    'insert into EMP ('
           || CHR (10)
           || 'EMPNO,'
           || CHR (10)
           || 'ENAME,'
           || CHR (10)
           || 'JOB,'
           || CHR (10)
           || 'MGR,'
           || CHR (10)
           || 'HIREDATE,'
           || CHR (10)
           || 'SAL,'
           || CHR (10)
           || 'COMM,'
           || CHR (10)
           || 'DEPTNO) values ('
           || DECODE (empno, NULL, 'Null', empno)
           || ','
           || CHR (10)
           || ''
           || DECODE (ename, NULL, 'Null', '''' || ename || '''')
           || ','
           || CHR (10)
           || ''
           || DECODE (job, NULL, 'Null', '''' || job || '''')
           || ','
           || CHR (10)
           || ''
           || DECODE (mgr, NULL, 'Null', mgr)
           || ','
           || CHR (10)
           || ''
           || DECODE (hiredate,
                      NULL, 'Null',
                         'to_date('''
                      || TO_CHAR (hiredate, 'mm/dd/yyyy hh24:mi')
                      || ''',''mm/dd/yyyy hh24:mi'')'
           || ','
           || CHR (10)
           || ''
           || DECODE (sal, NULL, 'Null', sal)
           || ','
           || CHR (10)
           || ''
           || DECODE (comm, NULL, 'Null', comm)
           || ','
           || CHR (10)
           || ''
           || DECODE (deptno, NULL, 'Null', deptno)
           || ');'
      FROM emp;
    SELECT '-- commit;'
      FROM DUAL;now run the baove select statement you will get the following insert statements
    /* Formatted on 2012/01/16 10:57 (Formatter Plus v4.8.8) */
    --'INSERT INTO EMP('||CHR(10)||'EMPNO,'||CHR(10)||'ENAME,'||CHR(10)||'JOB,'||CHR(10)||'MGR,'||CHR(10)||'HIREDATE,'||CHR(10)||'SAL,'||CHR(10)||'COMM,'||CHR(10)||'DEPTNO)VALUES('||DECODE(EMPNO,NULL,'NULL',EMPNO)||','||CHR(10)||''||DECODE(ENAME,NULL,'NULL',''''|
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm, deptno
         VALUES (7369, 'SMITH', 'CLERK', 7902,
                 TO_DATE ('12/17/1980 00:00', 'mm/dd/yyyy hh24:mi'), 800, NULL, 20
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm, deptno
         VALUES (7499, 'ALLEN', 'SALESMAN', 7698,
                 TO_DATE ('02/20/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1600, 300, 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm, deptno
         VALUES (7521, 'WARD', 'SALESMAN', 7698,
                 TO_DATE ('02/22/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1250, 500, 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7566, 'JONES', 'MANAGER', 7839,
                 TO_DATE ('04/02/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2975, NULL,
                 20
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7654, 'MARTIN', 'SALESMAN', 7698,
                 TO_DATE ('09/28/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1250, 1400,
                 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7698, 'BLAKE', 'MANAGER', 7839,
                 TO_DATE ('05/01/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2850, NULL,
                 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7782, 'CLARK', 'MANAGER', 7839,
                 TO_DATE ('06/09/1981 00:00', 'mm/dd/yyyy hh24:mi'), 2450, NULL,
                 10
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7788, 'SCOTT', 'ANALYST', 7566,
                 TO_DATE ('04/19/1987 00:00', 'mm/dd/yyyy hh24:mi'), 3000, NULL,
                 20
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7839, 'KING', 'PRESIDENT', NULL,
                 TO_DATE ('11/17/1981 00:00', 'mm/dd/yyyy hh24:mi'), 5000, NULL,
                 10
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm, deptno
         VALUES (7844, 'TURNER', 'SALESMAN', 7698,
                 TO_DATE ('09/08/1981 00:00', 'mm/dd/yyyy hh24:mi'), 1500, 0, 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7876, 'ADAMS', 'CLERK', 7788,
                 TO_DATE ('05/23/1987 00:00', 'mm/dd/yyyy hh24:mi'), 1100, NULL,
                 20
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm, deptno
         VALUES (7900, 'JAMES', 'CLERK', 7698,
                 TO_DATE ('12/03/1981 00:00', 'mm/dd/yyyy hh24:mi'), 950, NULL, 30
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7902, 'FORD', 'ANALYST', 7566,
                 TO_DATE ('12/03/1981 00:00', 'mm/dd/yyyy hh24:mi'), 3000, NULL,
                 20
    INSERT INTO emp
                (empno, ename, job, mgr,
                 hiredate, sal, comm,
                 deptno
         VALUES (7934, 'MILLER', 'CLERK', 7782,
                 TO_DATE ('01/23/1982 00:00', 'mm/dd/yyyy hh24:mi'), 1300, NULL,
                 10
                );i hope this helps .
    Thanks,
    P Prakash
    Edited by: prakash on Jan 15, 2012 9:21 PM
    Edited by: prakash on Jan 15, 2012 9:22 PM

  • How to move the data of a table from sqlplus to XML file

    Hi,
    Could you pls guide me how to move the data of a table from sqlplus to XML file.
    i want to do it from sqlplus rather than toad.pls help
    Thanks

    Oh..I'm in 9i.
    Try this out..and let me know.
    DECLARE
    CTX DBMS_XMLGEN.CTXHANDLE ;
    XML CLOB ;
    F UTL_FILE.FILE_TYPE;
    XMLC VARCHAR2(32767);
    BEGIN
    CTX := DBMS_XMLGEN.NEWCONTEXT('SELECT * FROM department1 ') ;
    XML := DBMS_XMLGEN.GETXML(CTX) ;
    XMLC:=TO_CHAR(XML);
    SHOW_ENVELOPE(XMLC);
    F := UTL_FILE.FOPEN('ATTACH_FILES','DEPT.XML', 'W');
    UTL_FILE.PUT_LINE(F,XML);
    UTL_FILE.FCLOSE(F);
    END ;
    Good luck!!!
    Bhagat
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can I restore MY RATINGS from the library.xml file alone?

    That's the question - Can I restore MY RATINGS from the library.xml file alone?
    Some facts to consider before replying:
    1. I do not have the ITL file, so that solution is out.
    2. My ipod was restored so NO ratings there either.
    3. So far I have only seen programs to use BEFORE losing your itunes library. IF YOU KNOW a third party's program can help me AFTER THE FACT then tell me about it.
    4. I HAVE searched these forums for previous threads. (a) searching engine needs big help and (b) among the 2 dozen finds, no solution for "only XML" found. If you got THAT threads url, post it!
    So, using an old library.xml file, is there a way to get this info into itunes.
    thanks
    Gc
    p4 3Ghz box   Windows XP Pro   only the ipod can lock it up
    p4 3Ghz box   Windows XP Pro   if you can give me $10K in replacement software, I'll be glad to switch to MAC

    there is mention of a hta
    script, SaveRatings.hta , that saves and restores
    the xml data.
    The save button worked just fine. ..........
    Turns out the restore button works just fine too when I dont toss in my homemade ratings.xml before clicking restore;-)
    more explained at http://discussions.apple.com/thread.jspa?threadID=587586&tstart=0
    anyway Otto's saveratings is a excellent tool to have on your drive. Unless you like re-rating 1400 or 1500 rated songs...........
    Gc
    p4 3Ghz box   Windows XP Pro   only the ipod can lock it up

  • Every time my Mac starts i see a Data.xml file in recycle bin

    every time my Mac starts i see a Data.xml file in recycle bin is that sort of malware ?

    Uninstall the program from the control panel or use a antimalware such as [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware].

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • Jazn-data.xml file, authentication in web.xml and embedded oc4j

    I've defined new security-roles, security-constraints and an authentication method in my web.xml file and i've created a new jazn-data.xml file that holds the different users and their groups.
    If I want to link the security-roles of the web.xml file to the roles in the jazn-data.xml file I always need an orion-application.xml file, is this correct?
    If I want to deploy an application as this to the embedded container the security won't work, I'm always getting the '403 forbidden' page.
    Can somebody point me out how I need to define security for an embedded and standalone environment when using authentication and jazn-data.xml file + how do I deploy this to a standalone oc4j and how to get this same application to work in the embedded oc4J.

    hi "romanna"
    Part of the answer to "Can somebody point me out how I need to define security ..." can probably be found in the "Oracle ADF Developer's Guide" that has "18 Adding Security to an Application".
    success
    Jan

  • I have created a user in oracle BPM but it is not reflected in system-jazn-data.xml file and I am unable to authenticate that user to create context as needed in workflow client

    I have created a user in oracle BPM but it is not reflected in system-jazn-data.xml file and I am unable to authenticate that user to create context as needed in workflow client

    weblogic credentials are different.
    and using thode credentials I am able to login to weblogic server
    the users I am talking about is the process users defined in realm.
    in realm those users are defined as Default authenticator and OID authenticator.
    and I am trying to authenticate one of those users defined in realm using java api so that I an access a process defined In Oracle BPM 11g

  • Error parsing ERwin 7.x File when I  tried to IMPORT repository format xml file in SQl Data Modeller

    This is what i got in the log file when i tried to import a relatively large file 1.7 GB xml file
    Import Finished
    Errors:   1
    Warnings: 0
    <<<<< ERRORS >>>>>
    Error parsing ERwin 7.x File:<File path>
    Please help.

    The error information in the External log file is
    ERROR ERwinHandler - ERwinHandler - Unable to parse ERwin 7.x file: <file path>
    java.lang.OutOfMemoryError: Java heap space
      at oracle.dbtools.crest.model.ModelIDObject.<init>(ModelIDObject.java:46)
      at oracle.dbtools.crest.model.design.DesignObject.<init>(DesignObject.java:111)
      at oracle.dbtools.crest.model.design.ContainedObject.<init>(ContainedObject.java:82)
      at oracle.dbtools.crest.model.design.ContainedObjectWithDomain.<init>(ContainedObjectWithDomain.java:76)
      at oracle.dbtools.crest.model.design.relational.FKElement.<init>(FKElement.java:14)
      at oracle.dbtools.crest.model.design.relational.Column.<init>(Column.java:148)
      at oracle.dbtools.crest.model.design.relational.Table.createColumn(Table.java:432)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.parseColumns(ERSAXParserv7x.java:1681)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.parseEntity(ERSAXParserv7x.java:1364)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.endEntitiesAndAttributes(ERSAXParserv7x.java:994)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.endElement(ERSAXParserv7x.java:428)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1666)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:458)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:404)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:245)
      at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:298)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler.parseFile(ERwinHandler.java:252)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler.access$500(ERwinHandler.java:51)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler$Runner.run(ERwinHandler.java:126)
      at java.lang.Thread.run(Thread.java:745)
    2015-02-11 14:38:12,680 [main] INFO  ApplicationView - Oracle SQL Developer Data Modeler 4.1.0.866
    2015-02-11 16:13:44,218 [Thread-33] ERROR ERwinHandler - ERwinHandler - Unable to parse ERwin 7.x file: <file_Path>
    java.lang.OutOfMemoryError: Java heap space

  • Is there better way to write SQl Insert Script

    I am running out of ideas while working on one scenario and thought you guys would be able to guide me in right way.
    So, the scenario is I have a Table table1 table1(fieldkey, DisplayName, type) fieldkey - pkey   This table have n number of rows. The value of fieldkey in nth row is n. So if we have 1000 record, then the last row has a fieldkey = 1000.
    Below is my sample data.
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1001, 'COfficer',100);
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1002, 'PData',100);
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1003, 'EDate',100);
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1004, 'PData',200);
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1005, 'EDate',300);
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    (1006, 'Owner',400);This way of inserting the row with hardcoded value of fieldkey was creating the problem when the same table was used by other developer for their own new functionality.
    So, I thought of using the max(fieldkey) +1 from that table and use it in my insert script. This script file runs every time during software installation.
    I thought of using count to see if the row with same displaytype and type exists in that table or not. If exisits do not insert new row, if not insert new row.
    It looks like i will have to query the count statement everytime before I insert the row.
    select max(fieldkey) +1 into ll_fieldkey from table1
    select count(*) into ll_count from table1 where display ltrim(upper(name)) = 'COFFICER' and type =100)
    if ll_count >0 then
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    ( ll_fieldkey, 'COfficer',100);
    ll_fieldkey := ll_fieldkey +1
    end if;
    select count(*) into ll_count from table1 where display ltrim(upper(name)) = 'PData' and type =100)
    if ll_count >0 then
    Insert into table1 (FIELDKEY,DISPLAYNAME,TYPE) values
    ( ll_fieldkey, 'PData',100);
    ll_fieldkey := ll_fieldkey +1
    end if;
    ... and so on for all the insert statement. So, i was wondering if there is some better way to handle this situation of inserting the data.
    Thank you

    Hi !
    For check if the same display name and type already exists in table i would use Unique Key , but then again instead of if statement you should code some exception handlers. ... Hm .. Unque key is by may opinion better solution as
    codeing checks .
    For faster inserts that is , smaller code .. if there is no rules for values and the values are fixed , in any case you have to do this 100 inserts. If you can "calculate" values then maybe you can figure out some code .. but effect will be the same as hundred insert stetements one after another .. Procedure with this 100 inserts is not so bad solution.
    You can fill with values a nested table and then use forall ... save exceptions insert and with above mentioned UK , maybe this will be better.
    T
    Edited by: ttt on 10.3.2010 13:01

  • Issue to load data from database to XML file. error: ODI-40768

    Hi,
    While I am trying to load data from database to XML following error is appearing.
    ODI-1228: Task TEST_XML_DATA (Integration) fails on the target XML connection MyLOCALXSD.
    Caused By: java.sql.SQLException: ODI-40768: Could not save the file <default>:C:\DATA_FILE\www.xml because a class java.io.IOException occurred and said: The filename, directory name, or volume label syntax is incorrect
         at com.sunopsis.jdbc.driver.xml.SnpsXmlFile.writeToFile(SnpsXmlFile.java:751)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlConnection.internalExecute(SnpsXmlConnection.java:769)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlPreparedStatement.execute(SnpsXmlPreparedStatement.java:46)
         at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:166)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
         at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.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)
    jdbc url: jdbc:snps:xml?d=C:\test_xsd.xsd&s=TESTSQL&re=employeesX&ro=true
    physical schema: TESTSQL
    Knowledge modules are:
    LKM: LKM SQL to SQL
    IKM: IKM XML Control Append
    CKM: CKM SQL
    Parameters set are:
    CREATE_XML_FILE: true
    XML_PATH:<default>:C:\DATA_FILE\www.xml
    I have tried to change the directory path but error is still there.
    Could some one please help me to resolve the issue?
    Regards,
    user1672911

    Hi,
    The trouble in "<default>:"  - if you set XML_PATH as C:\DATA_FILE\www.xml instead  <default>:C:\DATA_FILE\www.xml- it will work correctly.
    Greetings,
    Eugene

  • Issue with Adobe flex data.xml file not reachable from bsp behind firewall

    Hi Gurus,
    I have a problem with the <mx:HTTPService> tag the following is the actual tag,
    <mx:HTTPService
    id="Srv"
    url="data.xml"
    useProxy="false"
    method="POST" result="resultHandler(event)"/>
    When accessed locally I can see the data in the flex as the data.xml can be reached. when the same is accessed from internet behind firewall, the url is entirely different and the .swf file in the BSP page cannot access the data.xml. I cannot give the absolute url in the tag as the BSP page application is accessed differently in different servers. any help on this would be greatly appreciated
    Thanks
    Akbar

    Sorry somehow I missed this question, an even easier way to do this is to allow your Flash movie to "script" ( this is the default behavior for a Flex application ) and then call some javascript to obtain exactly what the page URL is and then go from there to get your data:
    import flash.external.ExternalInterface;
    import mx.utils.URLUtil;
    var
    if(ExternalInterface.available){
         pageURL = ExternalInterface.call("window.location.href.toString");
    // Do whatever you need with the URL here.
         var serverName:String = URLUtil.getServerNameWithPort(pageURL);
    -d

  • PL/SQL: numeric or value error when extracting xml file from tables.

    create or replace FUNCTION proc_generate_xml_from_tables(p_directory in varchar2,
    p_areaname in varchar2)
    return integer
    AS
    qryCtx DBMS_XMLGEN.ctxHandle;
    result CLOB;
    clob_len number := 0;
    file_ptr utl_file.file_type;
    oTableName restore_metadata.table_name%type;
    o_filename restore_metadata.table_name%type;
    cursor metadata_restore_list(p_area varchar2) is
    select * from restore_metadata
    where instr(area_name,upper(p_Area)) > 0
    order by degree;
    vtabcount number := 0;
    sql_stmt varchar2(300);
    BEGIN
    dbms_lob.createtemporary(result, true,dbms_lob.session);
    oTableName := upper('MAINT_ACTVS');
    vtabcount := 0;
    sql_stmt := 'select count(*) from ' || oTableName;
    execute immediate sql_stmt into vtabcount;
    o_filename := oTableName || '.xml';
    file_ptr := utl_file.fopen(p_directory,o_filename,'W');
    dbms_output.put_line(oTableName);
    qryCtx := dbms_xmlgen.newcontext('select * from ' || oTableName);
    result := dbms_xmlgen.getxml(qryCtx);
    --dbms_output.put_line(result);
    clob_len := dbms_lob.getlength(result);
    dbms_output.put_line('Length of the clob file' || clob_len);
    utl_file.put_line(file_ptr,result);
    utl_file.fclose(file_ptr);
    dbms_xmlgen.closeContext(qryCtx);
    dbms_lob.freetemporary(result);
    return 0;
    EXCEPTION
    when others THEN
    utl_file.fclose(file_ptr);
    dbms_output.put_line('Table Name into Consideration :- ' || oTableName);
    dbms_output.put_line('Oracle Error Number:- ' || sqlcode || ' Ora Message :- ' || sqlerrm);
    return -1;
    END;
    I am getting the following errors..
    SQL> @temp1.sql
    MAINT_ACTVS
    Length of the clob file34245
    Table Name into Consideration :- MAINT_ACTVS
    Oracle Error Number:- -6502 Ora Message :- ORA-06502: PL/SQL: numeric or value error
    What am I doing wrong here?
    DB version is Oracle 10g
    Edited by: userAtoZ on May 6, 2011 2:55 PM

    >
    My problem lies that my xml file is having data more than 32 K.
    When I write it 32K at a time then it work fine.
    >
    Then break it down.
    l_pos number;
    WHILE (l_pos <= clob_len)
      LOOP
        UTL_FILE.PUT_LINE (file_ptr,DBMS_LOB.SUBSTR ( RESULT , 32767,l_pos));
        l_pos := l_pos + 32767;
      END LOOP;
    utl_file.fclose(file_ptr);
     

  • Collect data from a dynamic XML file into multiple internal tables

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
    My XML file is of the following type.It is very complex and the dynamice.
    The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
    "I" and "L" are child tags of <C>
    <I>
           <J>10</J>
             <K>EN</K>
      </I>
    <L>
             <J>20</J>
              <N>BB</N>
      </L>
    Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
    I need to collect <D>, <E> in one internal table ITAB.
    I need to collect <G>, <H> in one internal table JTAB.
    I need to collect <J>, <K> in one internal table KTAB.
    I need to collect <J>, <N> in one internal table PTAB.
    Below is the complete XML file.
    ?xml version="1.0" encoding="iso-8859-1" ?>
    <A>
        <B/>
        <C>
           <D>RED</D>
           <E>999</E>
        <F>
           <G>TRACK</G>
           <H>PACK</H>
        </F>
        <I>
           <J>10</J>
           <K>EN</K>
        </I>
        <I>
           <J>20</J>
           <K>TN</K>
        </I>
        <I>
           <J>30</J>
           <K>KN</K>
        </I>
        <L>
           <J>10</J>
           <N>AA</N>
        </L>
        <L>
           <J>20</J>
           <N>BB</N>
        </L>
        <L>
           <J>30</J>
           <N>CC</N>
        </L>
        </C>
      </A>
    With the help of SDN I am able to gather the values of <D> <E> in one internal table.
    Now if I need to gather
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    I am unable to do. I am following  XSLT transformation method. If some one has some suggestions. Please help.
    Here is my ABAP program
    TYPE-POOLS abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
    * This is the structure for the data from the XML file
    TYPES: BEGIN OF ITAB,
             D(10) TYPE C,
             E(10) TYPE C,
           END OF ITAB.
    * Table for the XML content
    DATA: gt_itab       TYPE STANDARD TABLE OF char2048.
    * Table and work ares for the data from the XML file
    DATA: gt_ITAB     TYPE STANDARD TABLE OF ts_ITAB,
          gs_ITAB     TYPE ts_ITAB.
    * Result table that contains references
    * of the internal tables to be filled
    DATA: gt_result_xml TYPE abap_trans_resbind_tab,
          gs_result_xml TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    * Get the XML file from your client
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab1
      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 <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Fill the result table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IITAB".
    GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
    gs_result_xml-name = 'IITAB'.
    APPEND gs_result_xml TO gt_result_xml.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION zxslt
        SOURCE XML gt_itab1
        RESULT (gt_result_xml).
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Now let's see what we got from the file
    LOOP AT gt_ITAB INTO gs_ITAB.
      WRITE: / 'D:', gs_ITAB-D.
      WRITE: / 'E :', gs_ITAB-E.
    ENDLOOP.
    Transformation
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <IITAB>
              <xsl:apply-templates select="//C"/>
            </IITAB>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <item>
          <D>
            <xsl:value-of select="D"/>
          </D>
          <E>
            <xsl:value-of select="E"/>
          </E>
        </item>
      </xsl:template>
    </xsl:transform>
    Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
    Kindly help.
    Regards,
    VS

    Hi Rammohan,
    Thanks for the effort!
    But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
    Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields.  I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
    Moreover I have about 10 such work areas.  so the effort would be ten times the above effort! I want to avoid this! Please help!
    I would be very grateful if you could provide an alternative solution.
    Thanks once again,
    Best Regards,
    Vinod.V

Maybe you are looking for