Can we express batch relationship structure in XML in the database table

Hi
please help me ..
i have a batch XML batch structure ...can we express batch relationship structure in XML in tha database table?
yes..then how?
Thanks
Amu
Edited by: amu_2007 on Mar 25, 2010 6:57 PM
Edited by: amu_2007 on Mar 25, 2010 7:03 PM

But what is the problem with the initial solution given that split the XML into the data?
I mean you could do something like this?
SQL> create table batch (customer    VARCHAR2(10)
  2                     ,cust_name   VARCHAR2(10)
  3                     ,cust_type   VARCHAR2(10)
  4                     )
  5  /
Table created.
SQL>
SQL> create table section (customer    VARCHAR2(10)
  2                       ,sect_name   VARCHAR2(10)
  3                       ,sect_depend VARCHAR2(10)
  4                       )
  5  /
Table created.
SQL> create table job_sections (customer        VARCHAR2(10)
  2                            ,sect_name       VARCHAR2(10)
  3                            ,job_sect_name   VARCHAR2(10)
  4                            ,job_sect_depend VARCHAR2(10)
  5                            )
  6  /
Table created.
SQL> create table job (customer        VARCHAR2(10)
  2                   ,sect_name       VARCHAR2(10)
  3                   ,job_sect_name   VARCHAR2(10)
  4                   ,job_type        VARCHAR2(10)
  5                   ,job_sub_type    VARCHAR2(10)
  6                   ,job_depend      VARCHAR2(10)
  7                   )
  8  /
Table created.
SQL>
SQL>
SQL> insert all
  2    when batch_rn = 1 then
  3      into batch (customer, cust_name, cust_type) values (customer, cust_name, cust_type)
  4    when section_rn = 1 then
  5      into section (customer, sect_name, sect_depend) values (customer, sect_name, sect_dependency)
  6    when job_sections_rn = 1 then
  7      into job_sections (customer, sect_name, job_sect_name, job_sect_depend) values (customer, sect_name, job_sect_name, job_sect_dependency)
  8    when 1=1 then
  9      into job (customer, sect_name, job_sect_name, job_type, job_sub_type, job_depend) values (customer, sect_name, job_sect_name, job_type, jo
10  --
11  WITH t as (select XMLTYPE('
12  <BATCH customer="ABC" name="ABC1" type="ABC_TYPE">
13    <BATCH_SECTIONS>
14      <SECTION name="X" dependency="NULL">
15        <JOB_SECTIONS name="JOB1" dependency="NULL" >
16          <JOBS>
17            <JOB type="X" sub_type="xx" dependency="NULL" />
18            <JOB type="X" sub_type="yy" dependency="NULL" />
19            <JOB type="X" sub_type="zz" dependency="NULL" />
20          </JOBS>
21        </JOB_SECTIONS>
22      </SECTION>
23      <SECTION name="Y" dependency="X">
24        <JOB_SECTIONS name="JOB2" dependency="X" >
25          <JOBS>
26            <JOB type="Y" sub_type="xx" dependency="X" />
27            <JOB type="Y" sub_type="yy" dependency="X" />
28            <JOB type="Y" sub_type="zz" dependency="X" />
29          </JOBS>
30        </JOB_SECTIONS>
31      </SECTION>
32      <SECTION name="Z" dependency="Y">
33        <JOB_SECTIONS name="JOB3" dependency="NULL" >
34          <JOBS>
35            <JOB type="....." sub_type="...." dependency="NULL" />
36          </JOBS>
37        </JOB_SECTIONS>
38        <JOB_SECTIONS name="JOB4" dependency="NULL">
39          <JOBS>
40            <JOB type="...." sub_type="...." dependency="NULL" />
41          </JOBS>
42        </JOB_SECTIONS>
43      </SECTION>
44    </BATCH_SECTIONS>
45  </BATCH>
46  ') as xml from dual)
47  --
48  -- END OF TEST DATA
49  --
50  ,flat as (select a.customer, a.cust_name, a.cust_type
51                  ,b.sect_name, NULLIF(b.sect_dependency,'NULL') as sect_dependency
52                  ,c.job_sect_name, NULLIF(c.job_sect_dependency,'NULL') as job_sect_dependency
53                  ,d.job_type, d.job_sub_type, NULLIF(d.job_dependency,'NULL') as job_dependency
54            from t
55                ,XMLTABLE('/BATCH'
56                          PASSING t.xml
57                          COLUMNS customer     VARCHAR2(10) PATH '/BATCH/@customer'
58                                 ,cust_name    VARCHAR2(10) PATH '/BATCH/@name'
59                                 ,cust_type    VARCHAR2(10) PATH '/BATCH/@type'
60                                 ,bat_sections XMLTYPE PATH '/BATCH/BATCH_SECTIONS'
61                         ) a
62                ,XMLTABLE('/BATCH_SECTIONS/SECTION'
63                          PASSING a.bat_sections
64                          COLUMNS sect_name        VARCHAR2(10) PATH '/SECTION/@name'
65                                 ,sect_dependency  VARCHAR2(10) PATH '/SECTION/@dependency'
66                                 ,section         XMLTYPE      PATH '/SECTION'
67                         ) b
68                ,XMLTABLE('/SECTION/JOB_SECTIONS'
69                          PASSING b.section
70                          COLUMNS job_sect_name        VARCHAR2(10) PATH '/JOB_SECTIONS/@name'
71                                 ,job_sect_dependency  VARCHAR2(10) PATH '/JOB_SECTIONS/@dependency'
72                                 ,job_sections         XMLTYPE      PATH '/JOB_SECTIONS'
73                         ) c
74                ,XMLTABLE('/JOB_SECTIONS/JOBS/JOB'
75                          PASSING c.job_sections
76                          COLUMNS job_type        VARCHAR2(10) PATH '/JOB/@type'
77                                 ,job_sub_type    VARCHAR2(10) PATH '/JOB/@sub_type'
78                                 ,job_dependency  VARCHAR2(10) PATH '/JOB/@dependency'
79                         ) d
80            )
81  --
82  select customer, cust_name, cust_type, sect_name, sect_dependency, job_sect_name, job_sect_dependency, job_type, job_sub_type, job_dependency
83        ,row_number() over (partition by customer order by 1) as batch_rn
84        ,row_number() over (partition by customer, sect_name order by 1) as section_rn
85        ,row_number() over (partition by customer, sect_name, job_sect_name order by 1) as job_sections_rn
86  from flat
87  /
16 rows created.
SQL> select * from batch;
CUSTOMER   CUST_NAME  CUST_TYPE
ABC        ABC1       ABC_TYPE
SQL> select * from section;
CUSTOMER   SECT_NAME  SECT_DEPEN
ABC        X
ABC        Y          X
ABC        Z          Y
SQL> select * from job_sections;
CUSTOMER   SECT_NAME  JOB_SECT_N JOB_SECT_D
ABC        X          JOB1
ABC        Y          JOB2       X
ABC        Z          JOB3
ABC        Z          JOB4
SQL> select * from job;
CUSTOMER   SECT_NAME  JOB_SECT_N JOB_TYPE   JOB_SUB_TY JOB_DEPEND
ABC        X          JOB1       X          xx
ABC        X          JOB1       X          yy
ABC        X          JOB1       X          zz
ABC        Y          JOB2       Y          xx         X
ABC        Y          JOB2       Y          yy         X
ABC        Y          JOB2       Y          zz         X
ABC        Z          JOB3       .....      ....
ABC        Z          JOB4       ....       ....
8 rows selected.
SQL>But it would depend what you are actually after in terms of primary keys, and table relationships etc.
Let me put this simply for you...
h1. IF YOU DON'T DEMONSTRATE TO US WHAT OUTPUT YOU REQUIRE, WE CAN'T GIVE YOU AN ANSWER

Similar Messages

  • LSMW  Field Mapping: can't map Batch Input Structure for Session Data

    In step 5 Maintain Field Mapping and Conversion Rules, I can not see Batch Input Structure for Session Data Fields.
    Can somebody tell what's wrong?
    Here's what I see:
    Field Mapping and Rule
            BGR00                          Batch Input Structure for Session Data
                Fields
                BMM00                          Material Master: Transaction Data for Batch Input

    Hi Baojing,
    To see structure BGR00  you have to map this structure first with input file structure in step 4 (maintain structure relationship).
    Regards
    Dhirendra

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to trace the database table for a structure

    hi
    am trying to find the database table for a structure unfortunately am failing to use the sql tracer any one know howelse i can do that the structure name is 'busbankcheck' and 'bus000flds'.
    thanx in advance

    Hi florence,
      1)      U can go to tcode sldb and give ur structure name or if u can find which logical database it is from u can get the tables of the structure....
    Suppose it is of HR it may be like pnp logical database and then to sldb and give pnp and u can get all the table of that....
    2)If u know which fields u want from the stucture....then go to table DD03L and give ur fields name and it iwll bring where all tables this field is avaialble and u can find them......
    3) the st05 sql trace can help u.....
    I hope any one of the three will definetely help uuu
    Regards
    vamsi
    Edited by: vamsi talluri on Jan 22, 2009 1:24 PM

  • How can I pass multiple condition in where clause with the join table?

    Hi:
    I need to collect several inputs at run time, and query the record according to the input.
    How can I pass multiple conditions in where clause with the join table?
    Thanks in advance for any help.
    Regards,
    TD

    If you are using SQL-Plus or Reports you can use lexical parameters like:
    SELECT * FROM emp &condition;
    When you run the query it will ask for value of condition and you can enter what every you want. Here is a really fun query:
    SELECT &columns FROM &tables &condition;
    But if you are using Forms. Then you have to change the condition by SET_BLOCK_PROPERTY.
    Best of luck!

  • Can Discoverer have link to display documents stored outside the database?

    I posted a message some time ago called "Possible for Discoverer to display BLOB type documents stored in database?" and got great answer.
    Now our customers are asking if it is possible, from Discoverer, to link somehow to a file stored outside the database on the Unix file system and get their computer to display it? Can anyone tell me if this is possible please?
    The only thing I've seen in the documentation that may be related is in Oracle Business Intelligence Discoverer Configuration Guide, section 10.6 List of Discoverer user preferences. It says there that Discoverer preference ProtocolList can be set so that Discoverer hyperlinks can be set to use protocols such as telnet, but the default is HTTP, HTTPS, and FTP.
    THank you in advance if you can help.
    Regards,
    Julie.

    Hi Rod,
    I have tried the second method: "create a Oracle directory pointing to the Unix directory containing the files". I have had success with it, but I'd be grateful if you could advise me if you would have done this the same way as described below:
    I put two Word docs and two text docs called clob_test1.txt, clob_test2.txt, blob_test1.doc, blob_test2 in the Unix directory corresponding to an Oracle directory called 'EIF'. I thought an extrenal table was needed so that Discoverer would have an object to write a queruy against. So I created a file called lob_test_data.txt with the following contents:
    1,01-JAN-2006,text/plain,clob_test1.txt
    2,02-JAN-2006,text/plain,clob_test2.txt
    3,01-JAN-2006,application/msword,blob_test1.doc
    4,02-JAN-2006,application/msword,blob_test2.
    THen I created an external table using the following DDL:
    CREATE TABLE jum_temp_lob_tab (
    file_id NUMBER(10),
    date_content DATE,
    mime_type VARCHAR2(100),
    blob_content BLOB
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EIF
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    BADFILE EIF:'lob_tab_%a_%p.bad'
    LOGFILE EIF:'lob_tab_%a_%p.log'
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    file_id CHAR(10),
    date_content CHAR(11) DATE_FORMAT DATE MASK "DD-MON-YYYY",
    mime_type CHAR(100),
    blob_filename CHAR(100)
    COLUMN TRANSFORMS (blob_content FROM LOBFILE (blob_filename) FROM (EIF) BLOB)
    LOCATION ('lob_test_data.txt')
    PARALLEL 2
    REJECT LIMIT UNLIMITED
    then created a Discoverer End User Layer folder against this external table, and used exactly the same technique as we did for downloading the BLOB from the database table (creating a new folder item containing a URL calling a database procedure which calls the Oracle code to download the doc). THis worked, but sometimes my PC didn't seem to know that the Word docs were Word docs and it needed to launch Word. Other times it did manage to do this OK. It always displayed the two .txt files as HTML docs.
    Just wondered if you'd be good enough to critique this approach.
    THank you, Julie.

  • Loading XML files into Database table

    Loading XML files into Database table
    Hi I have some XML files say 100 files in a virtual directory created using &quot;Create or replace directory command&quot; and those files need to be loaded into a table having a column of XMLTYPE. 1)How to load that using Oracle provided procedures/packages

    Check out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
    Ben

  • JDeveloper can not transform XML in the database??

    HI Gentlemen,
    I have a small application to transform an XML instance from XQuery into HTML in some way. This should be done in an XSQL page in JDeveloper.
    I have the following experience:
    XQuery transformation is OK as long as the stylesheet is in the application as an XSL file
    <?xml version="1.0" encoding='windows-1252'?>
    <?xml-stylesheet type="text/xsl" href="rtest.xsl" ?>
    <!--<?xml-stylesheet type="text/xsl" href="/public/gks/kbv/gksadmin/rtest.xsl" ?>-->
    <page  connection="gksconnection" xmlns:xsql="urn:oracle-xsql" >
    <xsql:query>
    SELECT
      XMLQuery(
        'xquery version "1.0"; (: :)
         declare namespace n1="urn:ehd/001"; (: :)
         declare namespace n2="urn:ehd/go/001"; (: :)
         let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
         where $i[@n2:V = "01700V"]
         return $i'
        PASSING xml_document
        RETURNING CONTENT
      AS result
    FROM z
    </xsql:query>
    </page>Transformation is not done, when the same stylesheet is in XMLDB as a resource
    <?xml version="1.0" encoding='windows-1252'?>
    <!--<?xml-stylesheet type="text/xsl" href="rtest.xsl" ?>-->
    <?xml-stylesheet type="text/xsl" href="/public/gks/kbv/gksadmin/rtest.xsl" ?>
    <page  connection="gksconnection" xmlns:xsql="urn:oracle-xsql" >
    <xsql:query>
    SELECT
      XMLQuery(
        'xquery version "1.0"; (: :)
         declare namespace n1="urn:ehd/001"; (: :)
         declare namespace n2="urn:ehd/go/001"; (: :)
         let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
         where $i[@n2:V = "01700V"]
         return $i'
        PASSING xml_document
        RETURNING CONTENT
      AS result
    FROM z
    </xsql:query>
    </page>I am getting the following error message
    Oracle XML Developers Kit 11.1.1.3.0 - Production
    XML-25008: XSLT-Stylesheet kann nicht gefunden werden: /public/gks/kbv/gksadmin/rtest.xslFinally, transformation also fails when trying to use XMLtransform() and referencing the stylesheet thru XDBURITYPE().
    SELECT XMLSerialize(DOCUMENT
      XMLTransform(
        XMLQuery(
         'xquery version "1.0"; (: :)
          declare namespace n1="urn:ehd/001"; (: :)
          declare namespace n2="urn:ehd/go/001"; (: :)
          let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
          where $i[@n2:V = "01700V"]
          return $i'
         PASSING xml_document
         RETURNING CONTENT
      , xdburitype('/public/gks/kbv/gksadmin/rtest.xsl').getxml()
      AS CLOB INDENT
    FROM zCan anyone tell me: is there a safe way of transforming in the database with JDeveloper? I am all for avoiding the file system (where both techniques work fine!) and would like to perform each activity in the database, thereby being browser-independent.
    Thank you in advance, kind regards
    Miklos HERBOLY
    Edited by: mh**** on Apr 29, 2011 3:25 AM
    Edited by: mh**** on Apr 29, 2011 3:27 AM
    Edited by: mh**** on Apr 29, 2011 3:28 AM
    Edited by: mh**** on Apr 29, 2011 3:29 AM

    HI Gentlemen,
    I have a small application to transform an XML instance from XQuery into HTML in some way. This should be done in an XSQL page in JDeveloper.
    I have the following experience:
    XQuery transformation is OK as long as the stylesheet is in the application as an XSL file
    <?xml version="1.0" encoding='windows-1252'?>
    <?xml-stylesheet type="text/xsl" href="rtest.xsl" ?>
    <!--<?xml-stylesheet type="text/xsl" href="/public/gks/kbv/gksadmin/rtest.xsl" ?>-->
    <page  connection="gksconnection" xmlns:xsql="urn:oracle-xsql" >
    <xsql:query>
    SELECT
      XMLQuery(
        'xquery version "1.0"; (: :)
         declare namespace n1="urn:ehd/001"; (: :)
         declare namespace n2="urn:ehd/go/001"; (: :)
         let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
         where $i[@n2:V = "01700V"]
         return $i'
        PASSING xml_document
        RETURNING CONTENT
      AS result
    FROM z
    </xsql:query>
    </page>Transformation is not done, when the same stylesheet is in XMLDB as a resource
    <?xml version="1.0" encoding='windows-1252'?>
    <!--<?xml-stylesheet type="text/xsl" href="rtest.xsl" ?>-->
    <?xml-stylesheet type="text/xsl" href="/public/gks/kbv/gksadmin/rtest.xsl" ?>
    <page  connection="gksconnection" xmlns:xsql="urn:oracle-xsql" >
    <xsql:query>
    SELECT
      XMLQuery(
        'xquery version "1.0"; (: :)
         declare namespace n1="urn:ehd/001"; (: :)
         declare namespace n2="urn:ehd/go/001"; (: :)
         let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
         where $i[@n2:V = "01700V"]
         return $i'
        PASSING xml_document
        RETURNING CONTENT
      AS result
    FROM z
    </xsql:query>
    </page>I am getting the following error message
    Oracle XML Developers Kit 11.1.1.3.0 - Production
    XML-25008: XSLT-Stylesheet kann nicht gefunden werden: /public/gks/kbv/gksadmin/rtest.xslFinally, transformation also fails when trying to use XMLtransform() and referencing the stylesheet thru XDBURITYPE().
    SELECT XMLSerialize(DOCUMENT
      XMLTransform(
        XMLQuery(
         'xquery version "1.0"; (: :)
          declare namespace n1="urn:ehd/001"; (: :)
          declare namespace n2="urn:ehd/go/001"; (: :)
          let $i := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
          where $i[@n2:V = "01700V"]
          return $i'
         PASSING xml_document
         RETURNING CONTENT
      , xdburitype('/public/gks/kbv/gksadmin/rtest.xsl').getxml()
      AS CLOB INDENT
    FROM zCan anyone tell me: is there a safe way of transforming in the database with JDeveloper? I am all for avoiding the file system (where both techniques work fine!) and would like to perform each activity in the database, thereby being browser-independent.
    Thank you in advance, kind regards
    Miklos HERBOLY
    Edited by: mh**** on Apr 29, 2011 3:25 AM
    Edited by: mh**** on Apr 29, 2011 3:27 AM
    Edited by: mh**** on Apr 29, 2011 3:28 AM
    Edited by: mh**** on Apr 29, 2011 3:29 AM

  • Creating an XML for the database having link to a table in another database

    I have a database in which a table holds the link to table in different database.
    I am not able to create the XML file.It is giving me an error
    Error# 2516:XMLExporter Method Run of Object '_Application' Failed.
    Is there any alternate or round about process to generate an XML file.

    I assume this is MS Access database? What version?
    Is the link valid from within Access? Can you see the remote table?
    You could make a copy of this mdb file and just remove this link table to see if the exporter runs to completion without errors.
    Donal

  • Persist XML Data to Database Table - Generic XML Schema

    Hi,
    I would like to represent data in XML format and persist to any database tables.
    The ideal xml is like:
    <TABLE NAME="TABLE1">
    <TABLEDEF><COLUMN NAME="COLUMN1"/><COLUMN NAME="COLUMN2"/></TABLEDEF>
    <ROW><COLUMN VALUE="value1"/><COLUMN VALUE="value2"/></ROW>
    <ROW><COLUMN VALUE="value11"/><COLUMN VALUE="value22"/></ROW>
    </TABLE>     
    <TABLE NAME="TABLE2">
    </TABLE>     
    The XML could then be parsed, and saved to database with JDBC by manually composing the statement strings.
    To reduce the coding effort (xml parsing, JDBC connection, etc), are there any open source projects available to achieve the above purpose? The popular O/R mapping tools like Hibernate, Castor, etc, can't handle this scanario because they require the knowledge of the tables on the server side in order to create the mapping files in advance.
    Thanks for the help!

    Hi,
    I would like to represent data in XML format and persist to any database tables.
    The ideal xml is like:
    <TABLE NAME="TABLE1">
    <TABLEDEF><COLUMN NAME="COLUMN1"/><COLUMN NAME="COLUMN2"/></TABLEDEF>
    <ROW><COLUMN VALUE="value1"/><COLUMN VALUE="value2"/></ROW>
    <ROW><COLUMN VALUE="value11"/><COLUMN VALUE="value22"/></ROW>
    </TABLE>     
    <TABLE NAME="TABLE2">
    </TABLE>     
    The XML could then be parsed, and saved to database with JDBC by manually composing the statement strings.
    To reduce the coding effort (xml parsing, JDBC connection, etc), are there any open source projects available to achieve the above purpose? The popular O/R mapping tools like Hibernate, Castor, etc, can't handle this scanario because they require the knowledge of the tables on the server side in order to create the mapping files in advance.
    Thanks for the help!

  • Generating XML From the Database

    I'm having trouble formatting xml generated from the database. Here is the format I am trying to generate:
    <ADB_DOCUMENT DataSource="CUSTOM_ATTR" FormatVersion="1.1">
         <CUSTOM Table="LOT" Name="K12345.01">
              <ATTR Name="LOT_GROUP_ID" Value="FU023" />
              <ATTR Name="INGOT_ID" Value="FU023-002001" />
              <ATTR Name="VENDOR_LOT" Value="F98765-1" />
         </CUSTOM>
         <CUSTOM Table="PRODUCT" Name="KT5499">
              <ATTR Name="PHOTOCODE" Value="P-89" />
              <ATTR Name="DIE_STATUS" Value="" />
              <ATTR Name="WAFER_SIZE" Value="200" />
         </CUSTOM>
         <CUSTOM Table="EQUIPMENT" Name="KLA21XX">
              <ATTR Name="VENDOR" Value="KLA-Tencor" />
              <ATTR Name="GRADE" Value="A" />
              <ATTR Name="SERVICE" Value="NICE" />
              <ATTR Name="QUALITY" Value="WORLD-CLASS" />
         </CUSTOM>
    </ADB_DOCUMENT>
    The data is selected from a view. The SQL looks like this:
    SELECT ADB_DOCUMENT_DATASOURCE as "DataSource",
    ADB_DOCUMENT_FORMATVERSION AS "FormatVersion",
    CUSTOM_TABLE as "Table",
    CUSTOM_NAME AS "Name",
    ATTR_NAME AS "Name",
    ATTR_VALUE AS "Value"
    FROM EXPORT_TABLE;
    Here is an insert statement for the data:
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ApcDicdPriority','1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ApcOvlPriority','1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ApcOvlThread','353V1A1_XXXX');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ApcOvlTypUsed','45');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ERFID','EXECUTED');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','GateCD_Target_PLN','MEDIUM');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','GateCD_Value','48.29');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','LastReticle','3365DK0A0A1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','LastStepper','STP1308');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','OOC','DDT');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','PPCD','MD201020001UN');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','PPCDLevel','1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','SAPMaterialNumber','50000392');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','ShipDelay','1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','TurnkeyType','J');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','YMSStepID','M2-MSKADI');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','ApcDicdPriority','0');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','ApcOvlPriority','0');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','ApcOvlThread','354V4C1_XXXX');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','ApcOvlTypUsed','45');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','GateCD_Target_PLN','HOT');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','GateCD_Value','47.634');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','LastReticle','3250CU0TJC1');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','LastStepper','STP403');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','SAPMaterialNumber','50001396');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','ShipDelay','5');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','TurnkeyType','J');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','YMSStepID','TJ-MSKADI');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','SUB_LOT_TYPE','PROD-PO');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','SUB_LOT_TYPE','PROD-PX');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U0C28.00','STF_VERSION','3365DI.C0');
    Insert into EXPORT_TABLE (ADB_DOCUMENT_DATASOURCE,ADB_DOCUMENT_FORMATVERSION,CUSTOM_TABLE,CUSTOM_NAME,ATTR_NAME,ATTR_VALUE) values ('CUSTOM_ATTR','1.1','LOT','U100M.00','STF_VERSION','3250CN.C0');
    This is the sqlxml that I have created.
    SELECT XMLElement(
    "ADB_DOCUMENT" ,
    XMLAttributes(ADB_DOCUMENT_DATASOURCE as "DataSource", ADB_DOCUMENT_FORMATVERSION AS "FormatVersion"),
    XMLElement(
    "CUSTOM",
    XMLAttributes(CUSTOM_TABLE as "Table", CUSTOM_NAME AS "Name"),
    XMLAgg(
    XMLElement(
    "ATTR",
    XMLAttributes(ATTR_NAME AS "Name", ATTR_VALUE AS "Value")
    ) AS XML
    FROM EXPORT_TABLE
    GROUP BY ADB_DOCUMENT_DATASOURCE, ADB_DOCUMENT_FORMATVERSION, CUSTOM_TABLE, CUSTOM_NAME;
    And this is the output generated from the sqlxml:
    <ADB_DOCUMENT DataSource="CUSTOM_ATTR" FormatVersion="1.1"><CUSTOM Table="LOT" Name="U0C28.00"><ATTR Name="ApcDicdPriority" Value="1"></ATTR><ATTR Name="STF_VERSION" Value="3365DI.C0"></ATTR><ATTR Name="SUB_LOT_TYPE" Value="PROD-PO"></ATTR><ATTR Name="YMSStepID" Value="M2-MSKADI"></ATTR><ATTR Name="TurnkeyType" Value="J"></ATTR><ATTR Name="ShipDelay" Value="1"></ATTR><ATTR Name="SAPMaterialNumber" Value="50000392"></ATTR><ATTR Name="PPCDLevel" Value="1"></ATTR><ATTR Name="PPCD" Value="MD201020001UN"></ATTR><ATTR Name="OOC" Value="DDT"></ATTR><ATTR Name="LastStepper" Value="STP1308"></ATTR><ATTR Name="LastReticle" Value="3365DK0A0A1"></ATTR><ATTR Name="GateCD_Value" Value="48.29"></ATTR><ATTR Name="GateCD_Target_PLN" Value="MEDIUM"></ATTR><ATTR Name="ERFID" Value="EXECUTED"></ATTR><ATTR Name="ApcOvlTypUsed" Value="45"></ATTR><ATTR Name="ApcOvlThread" Value="353V1A1_XXXX"></ATTR><ATTR Name="ApcOvlPriority" Value="1"></ATTR></CUSTOM></ADB_DOCUMENT>
    <ADB_DOCUMENT DataSource="CUSTOM_ATTR" FormatVersion="1.1"><CUSTOM Table="LOT" Name="U100M.00"><ATTR Name="ApcDicdPriority" Value="0"></ATTR><ATTR Name="STF_VERSION" Value="3250CN.C0"></ATTR><ATTR Name="SUB_LOT_TYPE" Value="PROD-PX"></ATTR><ATTR Name="YMSStepID" Value="TJ-MSKADI"></ATTR><ATTR Name="TurnkeyType" Value="J"></ATTR><ATTR Name="ShipDelay" Value="5"></ATTR><ATTR Name="SAPMaterialNumber" Value="50001396"></ATTR><ATTR Name="LastStepper" Value="STP403"></ATTR><ATTR Name="LastReticle" Value="3250CU0TJC1"></ATTR><ATTR Name="GateCD_Value" Value="47.634"></ATTR><ATTR Name="GateCD_Target_PLN" Value="HOT"></ATTR><ATTR Name="ApcOvlTypUsed" Value="45"></ATTR><ATTR Name="ApcOvlThread" Value="354V4C1_XXXX"></ATTR><ATTR Name="ApcOvlPriority" Value="0"></ATTR></CUSTOM></ADB_DOCUMENT>
    The problems I am trying to resolve are:
    1. THE <ADB_DOCUMENT> tag is generated for each row. I just want 1 <ADB_DOCUMENT> tag to wrap the entire document.
    2. I need a linefeed character (\n in c) at the end of each tag as in the sample output in the beginning of the post. I tried concatenating a chr(10) to the end of the </ATTR> tags, but sqlplus truncates anything after the chr(10) in the output file. (I am piping this output to a file using a table function).
    Any help would be greatly appreciated!

    1. THE <ADB_DOCUMENT> tag is generated for each row. I just want 1 <ADB_DOCUMENT> tag to wrap the entire document.You have to deal with two levels of aggregation, so here's one way to do it :
    SELECT XMLElement("ADB_DOCUMENT",
             XMLAttributes(adb_document_datasource as "DataSource", adb_document_formatversion as "FormatVersion"),
             XMLAgg(custom_element)
           ) as xmlresult
    FROM (
      SELECT adb_document_datasource
           , adb_document_formatversion
           , XMLElement("CUSTOM",
               XMLAttributes(custom_table as "Table", custom_name AS "Name"),
               XMLAgg(
                 XMLElement("ATTR",
                   XMLAttributes(attr_name AS "Name", attr_value AS "Value")
             ) as custom_element
      FROM export_table
      GROUP BY adb_document_datasource
             , adb_document_formatversion
             , custom_table
             , custom_name
    GROUP BY adb_document_datasource
           , adb_document_formatversion
    2. I need a linefeed character (\n in c) at the end of each tag as in the sample output in the beginning of the post.Do you really need to introduce whitespaces in your document?
    Depending on your database version, there are two methods to serialize your output and pretty-print it :
    11g : XMLSerialize function, with the INDENT option
    10g : Extract function
    For example,
    SELECT XMLSerialize(document
             XMLElement("ADB_DOCUMENT",
             as clob indent size = 2
    FROM ...
    SELECT XMLElement("ADB_DOCUMENT",
           ).extract('/*').getclobval()
    FROM ...You can then use DBMS_XSLPROCESSOR.clob2file to write the file with a single call.
    Edited by: odie_63 on 18 août 2011 22:14

  • How to insert large xml data into database tables.

    Hi all,
    iam new to xml. i want to insert data in xml file to my database tables.but the xml file size is very large. performance is also one of the issue. can anybody please tell me the procedure to take xml file from the server and insert into my database tables.
    Thanks in advance

    Unfortunately posting very generic questions like this in the forum tends not to be very productive for you, me or the other people who read the forum. It really helps everyone if you take a little time to review existing posts and their answers before starting new threads which replicate subjects that have already been discussed extensively in previous threads. This allows you to ask more sensible questions (eg, I'm using this approach and encountering this problem) rather than extremely generic questions that you can answer yourself by spending a little time reviewing existings posts or using the forum's search feature.
    Also in future your might want to try being a little more specific before posting questions
    Eg Define "very large". I know of customers who thing very large is 100K, and customers who think 4G is medium. I cannot tell from your post what size your files are.
    What is the content of the file. Is it going to be loaded into a single record, or a a single table, or will it need to be loaded into multiple records in a single table or multiple records in multiple tables ?
    Do you really need to load the data into exsiting relational tables or could your application work with relational views of the XML Content.
    Finally which release of the database are you working with.
    Define performance. Is it reasonable to expect to process this kind of document on this machine (Make, memory, #number of CPUs, CPU Speed, number of discs) in this period of time.
    WRT to your original question. If you take a few minutes to search this forum you will find a very large number of threads with very similar titles to yours. These theads document a number of different approaches that can be used to solve this problem.
    I suggest you start by looking for threads that cover topics like DBMS_XMLSTORE, XMLTable(), Relational Views of XML content, loading XML content in relational tables.

  • Can IdM use TimeStamp files in its Active Sync for Database table ?

    I have an IdM 7.1 implementation that I inherited
    and have a Database Table resource adapter with Active Sync.
    Here's a few ways to set up Active Sync, but I want to explore the latter.
    -Static Search Predicate (clause)
    You can use a flag (column) in your data table. Does not require any mapping, and presumably whatever process you're kicking off would turn off the flag, so the record is not picked up subsequently.
    -Last Fetched Predicate (documented in the Resource Reference, under Database Table),
    Normally, you'd be doing a comparison based on timestamps, and the mapping between a timestamp-User Extended Attribute AND timestamp-Database Column
    In this implementation, I do not see a User Extended Attribute (UXA) but I do see a 0 byte timestamp file on the server. Did not see anything like this discussed in the docs, but my hypothesis is that this is being used, or has been configured somehow. I wonder if I am right ?
    Let's call it 'MyTS'
    I see MyTS both in ActiveSync logs, as well as in the 'XML Data' object, resource_SYNC, that A/S creates. Maybe this is a hidden feature, or mostly undocumented, or from an earlier version. Anyone care to offer a suggestion or explanation ? Your thoughts would be welcome.
    thanks

    'MyTS' would be a resource attribute. Have a look in the schema map for your resource.
    It doesn't need to be, and would not normally be, a user extended attribute.

  • 10g express, how to change port number for the database home page

    10g express uses port 8080 for its http listener. However this number has been used by Tomcat on my computer. How can I chang the port number for the 10g home page?
    Regards
    jl

    Andy, thank you very much, I have been able to changed the port number following your advice.
    I hope you do not mind I ask a further questions along this line:
    I installed 10 express db on 2 computers. One with Tomcat and the other without. Following your advice, I successfully changed the port number on the one without Tomcat.
    On the one with Tomcat, I believe it was because I installed the 10g express while the Tomcat was running, I can neither go to the 10g's home page (page cannot be displyed), nor logon to the database from sqlplus (ora-12560: TNS:protocal error) even after I shut down the Tomcat. By checking with 'netstat -an', it is known that the http listerner is not listerning.
    Can I change some configuration file to solve this problem? Or do I have to reinstall 10 ex? I prefer the 1st aproach of changing config file, even it is not as easy as reinstallation.
    Thanks
    jl

  • Generating xml file from database table

    Could anyone please explain how to generate a xml file from a database table.examples will be highly appreciated.
    thanks in advance

    See the release notes for our XSQL Pages component of the Java XDK for a tutorial. There are also lots of examples in Building Oracle XML Applications.
    You use the XML SQL Utility component to accomplish the task. It's part of our Java XDK that you can download from http://otn.oracle.com/tech/xml

Maybe you are looking for

  • Keys Not Working - Weird?!

    Hi Guys I have a 6 month old black Macbook. Absolutely love it after being a Windows user for many years. However, over the last month or so, a strange problem has appeared. Sometimes (not always) when I log in, for the first 10-20 minutes, the delet

  • Boot from HP dv4t external HD

    I just bought a 2.5 GHz macbook pro recently so I am still new to this. I'm switching from HP. My problem is this: I have a program "crack dat pat" that's locked onto my HP HD. Thus, I can't reformat the HD or transfer the program file onto another H

  • Can't install Adobe Flash CC 2014  :Exit Code: 16 Please see specific errors below for troubleshooting.

    Exit Code: 16 Please see specific errors below for troubleshooting. For example, ERROR: DW039 ... -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 1 error(s) ERROR: DW039: Failed to load deploy

  • Wont publish

    I am new to Iweb. I have made a site and bought an .mac.account. But the page wont publish. I have tried several times. any ideas?

  • On Completer of Service Confirmation - Which BADI to use

    Hi Experts, I am creating a service confirmation from the Service Order, once service confirmation is done then click on Complete button and then Save. I want to do coding at the time of hitting the complete button.For this which is the BADI to use.