XML in the database

Having just attended a session on Oracle/XML at OpenWorld... it
is still not clear where or when Oracle will provide a suitable
solution for the storage and retreival of XML documents with
highly-flexible schemas.
As I understand it, the existing solutions (8.1.5) (with
performance as an imporant consideration) are:
- Use Intermedia with section searching/indexing. This is not
suitable for applications with highly-flexible schemas. From my
understanding of Intermedia, indexing for section searching
requires explicit section definitions -- an expensive operation
for large databases. This would be similar to creating a new
index on a table for each new element the user desires to search
on.
- Map to a structured schema. While this is effective for
applications with very static schemas or leveraging existing
database schemas, with a highly-flexible document schema this
implies either a) creating new "shadow" tables for each distinct
schema or b) altering the table with each addition of a new
document element.
I am very eager to see what Oracle has to offer in this area. I
can find no technical documentation discussion any soon-to-come
approaches. I have heard mention at OpenWorld of expansions to
Intermedia to support name-value pair searching, etc., but still
no in-depth explanations.
Can anyone here shed any light on this?
null

Craig Willis (guest) wrote:
: Having just attended a session on Oracle/XML at OpenWorld...
it
: is still not clear where or when Oracle will provide a
suitable
: solution for the storage and retreival of XML documents with
: highly-flexible schemas.
: As I understand it, the existing solutions (8.1.5) (with
: performance as an imporant consideration) are:
: - Use Intermedia with section searching/indexing. This is not
: suitable for applications with highly-flexible schemas. From
my
: understanding of Intermedia, indexing for section searching
: requires explicit section definitions -- an expensive
operation
: for large databases. This would be similar to creating a new
: index on a table for each new element the user desires to
search
: on.
: - Map to a structured schema. While this is effective for
: applications with very static schemas or leveraging existing
: database schemas, with a highly-flexible document schema this
: implies either a) creating new "shadow" tables for each
distinct
: schema or b) altering the table with each addition of a new
: document element.
: I am very eager to see what Oracle has to offer in this area.
I
: can find no technical documentation discussion any soon-to-
come
: approaches. I have heard mention at OpenWorld of expansions
to
: Intermedia to support name-value pair searching, etc., but
still
: no in-depth explanations.
: Can anyone here shed any light on this?
If you are looking for a document-centric solution, you should
check out the Oracle Internet File System (iFS) which supports
XML. They have a demo at the Oracle campground.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • 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

  • 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

  • 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

  • Read XML into the database

    Hi,
    If I have a XML file and want to read its attributes into matching columns in a table, what is the best way to map the xml e.g. firstname to a firstname column in the table?
    <name>
    <firstname>Bill</firstname>
    <last>Gates</last>
    </name>
    Thanks

    Why do you want to do this? (Might help with the answer).

  • 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

  • Store XML Publisher report in the database

    Hi all,
    Is is possible to generate an XML Publisher report in the background and store the report as a blob in the database. I have an APEX application that needs to generate the report when the user clicks an 'Update' button. This report can then be accessed at a later date (via a hyper-link on another page) and will show the report that was stored on that date. Basically the report needs to be point in time.
    Thanks
    Grant

    Hi,
    you might have your reasons to want to store the entire report in the db as an object ... But wouldn't it be simpler to just add an extra DATE column to filter, and generate the report at runtime?
    What if the data changes in the meantime?
    Just, an idea ...
    Grtz.

  • How to load a XML file into the database

    Hi,
    I've always only loaded data into the database by using SQL-Loader and the data format was Excel or ASCII
    Now I have to load a XML.
    How can I do?
    The company where I work has Oracle vers. 8i (don't laugh, please)
    Thanks in advance!

    Hi,
    Tough job especially if the XML data is complex. The have been some similar question in the forum:
    Using SQL Loader to load an XML File -- use 1 field's data for many records
    SQL Loader to upload XML file
    Hope they help.
    Regards,
    Sujoy

  • I want to store an xml file into database, and transport it to the XI.

    tell me  in how many ways we can store a xml file in database.
    one i know is.- create a table with field same as that of XML. store XML file data in it
    and at the time of transfering data to XI fatch data from table and create an XML file and transfer...
    tell me if u know some more

    Dear Swethi,
    You can move images to SAP using SE78. then u can use them where ever u you require them.
    SE78->GRAPHICS->BMAP here give ur image name and click on save
    Rgds,
    Kiran
    Edited by: Kiran on Jun 11, 2009 7:15 AM

  • How to parse XML string fetched from the database

    i want to parse the XML string which is fetched from the oracle database.
    i have inserted the string in xml format in the database. The type of the field in which it is inserted is varchart2.
    I am successfully getting it using jdbc, storing it in a String.
    Now it is appended with xml version 1.0 and string is ready for parsing.
    Now i am making following programming.
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = Builder.parse(xmlString);
    Element root = doc.getDocumentElement();
    NodeList node = root.getElementsByTagName("product");
    But i am getting IOException at the statement
    Document doc = Builder.parse(xmlString);
    there fore i request u to kindly help me in solving this error.
    -regards
    pujan

    DocumentBuilder does not have a method parse with xml string as aparameter. The string should be a xml document uri.
    Convert xml string to StringReader.
    parse(new InputSource(new StringReader(xmlString)));

  • Convert the Database records to a standard XML file format?

    Hai,
    i want to convert the Database records to a standard XML file
    format which includes the schema name, table name, field name
    and field value. i am using Oracle 8.1.7. Is there any option
    please help me
    Thanks in advance.

    You could put the files somewhere and I can export them as QuickTime. Or you could find anyone you know who has Director. Or do the 30 day trial download
    Another approach would be to play the DCR in a browser window, and do a screen recording. But that’s unlikely to give the perfect frame rate that you would get by exporting from Director.

  • Would you put XML and HTML files stored in the database as files?

    Hi,
    Basically that is my question. My criteria is that I will be given some XML files, I need to save the XML file somewhere for future reference. However I also have to store when it was registered and so on.
    Would you install this in the database? Or you would just store the path where it is deployed?
    Regards,
    Sim085

    Hi,
    Basically that is my question. My criteria is that I
    will be given some XML files, I need to save the XML
    file somewhere for future reference. However I also
    have to store when it was registered and so on. So the XML won't be changing unless the registration date is updated?
    A file modification time could give you the same effect.
    Would you install this in the database? Or you would
    just store the path where it is deployed?I'd favor the latter for the sake of an argument.
    If you put it in the database, you wouldn't be able to query for the XML except by ID or registration date. Not much point in having it there.
    %

  • Inset a XML file in the database

    How to insert the XML file in the XML type field in the database?

    This will work
    INSERT INTO nonexistant_table
       (xml_col)
      VALUES
       (XMLTYPE('<?xml version="1.0"?>
                 <rnode>
                   <cnode1>value</cnode1>
                 </rnode>')
       );but without knowing what version you are on and what your requirements really are I can't say what other options are available to you. Just search this forum for INSERT, look at some of the methods that are being used to load XML into a table and then read up on the corresponding Oracle documentation.

  • Can I get the oracle database schema in xml like the original ones

    Working with Migration Workbench I've found that uses an XML
    with the schema of the original database. I'm asking if I can
    get the equivalent XML for the oracle model.
    I need a quickly way of get in XML the structure (not data) of
    my oracle databases.
    Any idea?

    Ok, it is unclear on what is happening here.
    Are you saying that when the webclient gets the data that it is not honoring the quote characters? Or the processing of the data buffer is causing issues?
    This is what I see the of your example text which is trying to be parse out:
    <a onmouseover="EnterContent('ToolTip','תווית על בגד: &rsquo;&rsquo;תן לאישה לכבס. זה תפקידה&rsquo;&rsquo;','<u><span style=color:#000099;>כתב: Spook בתאריך: 08.03.15 שעה: 22:11</span></u><br>מחאת טוויטר קמה בעקבות תוויות שוביניסטיות שהדפיסה חברת אופנה באינדונזיה לפיהן תפקיד הכביסה מוטל על האישה. החברה התנצלה אך כנראה רק עשתה רק יותר נזק לע...'); Activate();">";
    It appears to me that the  escapes `&rsquo;` does not have matching `&ldquo;` anywhere within the tooltip. So it appears that the page properly places left quotes in when processing the page, but the raw html has broken text.
    Hence a garbage in, garbage out situation.
    William Wegerson (www.OmegaCoder.Com)

Maybe you are looking for

  • Error while running jspx page from Jdeveloper

    Hi, I'm trying to customize LegalEntityDashboard.jspx of finance common ear , but while running the page from Jdeveloper I'm getting below error, <04-Nov-2013 07:12:05 o'clock GMT> <Warning> <Munger> <BEA-2156203> <A version attribute was not found i

  • Submit by email function on adobe reader

    I'm trying to apply for a job using an online application on the company's website. The company uses adobe reader. After filling out all the information I click on the submit by email button and get a message saying, "please on enter numerical data f

  • How to i get my screen to return to normal size after accidentally zooming it in

    How do I get my screen to return to normal size after accidentally zooming in

  • Power outage Mailbox Database won't mount

    Hello, We have experienced a power outage, when we brought the server back the Mailbox Database wouldn't mount. After that i ran Eseutil /mh and was on dirty shutdown, the i did /r and finally /p Database is now on Clean shutdown state but still does

  • IPhoto videos won't play with Snow Leopard

    Snow Leopard is hostile to my fonts, my trackpad, and now my iPhoto videos. When I double-click on the videos, they no longer open in QuickTime or do anything, they won't play. Any suggestions? (Uninstall Snow Leopard?) Thanks in advance.