How to retrieve several key/XML attributes

Hi community, we get this doc XML, we want to extract the Alias. As the Alias is defined as several key/attribute pairs. How can we do this? The sql below works but when how we flatten alias so the button under the column name and the value is value line?

with xmltst as (select
--/SWs/SW[1]/Aliases/Alias[4]
xmltype (
'<?xml version="1.0" encoding="UTF-8"?>
<SWs version="1.0" xsi:schemaLocation="http://xmlns.kazuneric.com/it/eng/v1 /kazuneric/v1/AssDataInternal-1_0.xsd"
xmlns="http://xmlns.kazuneric.com/v1" xmlns:ext="http://xmlns.kazuneric.com/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Aliases>
        <Alias Key="ProxyVersion">5.5.7075.0</Alias>
        <Alias Key="SiliconUnitsGenerationComments">9 units missing out of 959</Alias>
        <Alias Key="ReconWaferScribedID">82541239.0106C3</Alias>
        <Alias Key="ReconLotID">000PM50601P.0M0</Alias>
        <Alias Key="PnP_ProcessSegment">RECON</Alias>
        <Alias Key="PnP_EquipmentID">3DPNP6-D</Alias>
        <Alias Key="PnP_ProcessModule">RECON</Alias>
        <Alias Key="PnP_OperationName">RECON_PNP</Alias>
        <Alias Key="PnP_OperationNumber">052</Alias>
        <Alias Key="PnP_Operator">10010512</Alias>
        <Alias Key="PnP_ReconCarrierID">1020349</Alias>
        <Alias Key="PnP_ReconTapeBatchID">tape batch example</Alias>
        <Alias Key="PnP_StartTimestamp">2015-02-08T11:07:43+08:00</Alias>
        <Alias Key="PnP_EndTimestamp">2015-02-08T11:07:43+08:00</Alias>
      </Aliases>  
<SW s_ID="T6B890.00-01" t_ID="T6B890.00">
      <Ds>
<De sX="59" sY="-57" rX="7" rY="22" m_ID="L" eTime_s="2014-12-12T02:22:11+08:00" eTime_e="2014-12-12T02:22:42+08:00" mst="0.631"/>
<De sX="70" sY="-57" rX="7" rY="23" m_ID="L" eTime_s="2014-12-12T02:22:12+08:00" eTime_e="2014-12-12T02:22:33+08:00" mst="0.217"/>
<De sX="69" sY="-57" rX="47" rY="1" m_ID="R" eTime_s="2014-12-12T02:22:16+08:00" eTime_e="2014-12-12T02:22:56+08:00" mst="0.974"/>
</Ds>
</SW>
<SW s_ID="T6B890.00-02" t_ID="T6B890.00">
<Ds>
<De sX="56" sY="-1" rX="72" rY="19" m_ID="R" eTime_s="2014-12-12T02:36:01+08:00" eTime_e="2014-12-12T02:36:29+08:00" mst="0.541"/>
<De sX="57" sY="-1" rX="39" rY="42" m_ID="L" eTime_s="2014-12-12T02:22:12+08:00" eTime_e="2014-12-12T02:23:01+08:00" mst="0.426"/>
<De sX="58" sY="-1" rX="72" rY="20" m_ID="R" eTime_s="2014-12-12T02:36:07+08:00" eTime_e="2014-12-12T02:36:18+08:00" mst="0.716"/>
</Ds>
</SW>
</SWs>') xmldata
from dual
)
SELECT
x1.s_id, x1.t_id,x2.*
FROM xmltst t,
XMLTABLE (
          xmlnamespaces(
                        default 'http://xmlns.kazuneric.com/v1'
                       ),
'/SWs/SW'
PASSING t.xmldata
COLUMNS s_ID varchar2(30) PATH '@s_ID',
t_ID varchar2(30) PATH '@t_ID',
ds xmltype PATH 'Ds'
) x1
,XMLTABLE (
          xmlnamespaces(
                        default 'http://xmlns.kazuneric.com/v1'
                       ),
'Ds/De'
PASSING x1.ds
COLUMNS sX number PATH '@sX',
sY number PATH '@sY',
rX number PATH '@rX',
rY number PATH '@rY',
eTime_s varchar2(30) PATH '@eTime_s',
eTime_e varchar2(30) PATH '@eTime_e',
mst number PATH '@mst'
) x2

Just to add more columns to X 3:

with xmltst in (select

-/ SWs/SW [1] / alias/Alias [4]

XmlType)

'

http://xmlns.kazuneric.com/it/Eng/v1 /kazuneric/v1/AssDataInternal-1_0.xsd.

"xmlns ="http://xmlns.kazuneric.com/v1"xmlns:ext ="http://xmlns.kazuneric.com/v1"xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance">".

     

        5.5.7075.0

        9 missing units on 959

        82541239.0106C3

        000PM50601P.0M0

        RECON

        3DPNP6-D

        RECON

        RECON_PNP

        052

        10010512

        1020349

        example of batch of tape

        2015 02-08 T 11: 07:43 + 08:00

        2015 02-08 T 11: 07:43 + 08:00

        

     

XMLDATA ')

of the double

)

SELECT

x 1 .s_id, x1.t_id,

x 3. ProxyVersion,

X3.comments,

X2.*

OF xmltst t.

XMLTABLE)

XmlNamespaces)

default 'http://xmlns.kazuneric.com/v1'.

),

"/ SWs/SW.

PASSAGE t.xmldata

COLUMNS s_ID varchar2 (30) path "@s_ID",.

t_ID varchar2 (30) path "@t_ID",.

DS xmltype PATH "/ SW/Ds.

) x 1

XMLTABLE)

XmlNamespaces)

default 'http://xmlns.kazuneric.com/v1'.

),

"Ds/en.

PASSAGE x1.ds

SX number PATH "@sX"COLUMNS,

sY number PATH "@sY",

rX number PATH "@rX",

rY number PATH "@rY",

eTime_s varchar2 (30) path "@eTime_s",.

eTime_e varchar2 (30) path "@eTime_e",.

STD number PATH "@mst"

) x 2,

XMLTABLE)

XmlNamespaces)

default 'http://xmlns.kazuneric.com/v1'.

),

"/ SWs/alias.

PASSAGE t.xmldata

COLUMNS

["Varchar2 (15) PATH of the ProxyVersion ' Alias[@Key="ProxyVersion "]',

Comments Varchar2 (20) PATH "Alias[@Key="SiliconUnitsGenerationComments"]"

) x 3

/

S_ID T_ID PROXYVERSION COMMENTS SX SY RX RY ETIME_S ETIME_E STD
------------ --------- --------------- -------------------- --- --- --- --- ------------------------- ------------------------- -----
T6B890.00 - 01 T6B890.00 5.5.7075.0 9 units Miss-59 57 7 22 2014-12 - T 12, 02: 22:11 + 08:00 12-2014-T 12, 02: 22:42 + 08:00.631
T6B890.00 - 01 T6B890.00 5.5.7075.0 9 units Miss 70 57 7 2014 23-12 - T 12, 02: 22:12 + 08:00 12-2014-T 12, 02: 22:33 + 08:00.217
T6B890.00 - 01 T6B890.00 5.5.7075.0 9 units Miss 69 57 47 1 2014-12 - T 12, 02: 22:16 + 08:00 12-2014-T 12, 02: 22:56 + 08:00.974
T6B890.00 - 02 T6B890.00 5.5.7075.0 9 units Miss 56-1 72 19 2014-12 - T 12, 02: 36:01 + 08:00 12-2014-T 12, 02: 36:29 + 08:00.541
T6B890.00 - 02 T6B890.00 5.5.7075.0 9 units miss at 57-1 39 42 2014-12 - T 12, 02: 22:12 + 08:00 12-2014-T 12, 02: 23:01 + 08:00.426
T6B890.00 - 02 T6B890.00 5.5.7075.0 9 units miss at 58-1 72 20 2014-12 - T 12, 02: 36:07 + 08:00 12-2014-T 12, 02: 36:18 + 08:00.716

6 selected lines.

SQL >

SY.

Tags: Database

Similar Questions

  • How to press several keys when asked [Ubuntu)

    Hi all

    How should I do to be able to use a keyboard in a Skype-to-Skype call?

    The nine points button which is usually appearing in the basis of the appeal of windows doesn't work.

    I use Skype 4.0 for ubuntu 12.04

    Thanks already,

    Jemdem

    Move the mouse to the bottom of the window and after the menu icons will be visible D key (9 point icon in the middle is a keyboard). Click it with the mouse...

  • How to retrieve several values an adapter DB to a Web Service

    Hello

    I create a connection WS who receives the user name and password and returns the status of the user, the full name and a set of permissions (the number of permissions varies between users).

    To do this I created a DBAdapter who calls a PL/SQL procedure. This DBAdapter is connected to the Web Service connection through a mediator.

    I have two problems:

    1. I don't know the type of variable that the PL\SQL procedure must return. As I said I need to retrieve any number of values in a table (the user's permissions). How can I do this inside a PL\SQL procedure? What sort of structure I would stay?

    2 - How can I assign a variable of multiple value (the variable of permission) in the Ombudsman? Is the Ombudsman going to identify it as variable is multiple value and automatically add a for-each statement?


    The version im using Oracle DB is the 11.1.0.7.0 and the Oracle SOA Suite 11.1.1.3.0.

    Thanks in advance,
    Paulo

    You can generate an XMLType (of a VARCHAR2 variable, so) within the PL/SQL procedure. Please see-

    http://download.Oracle.com/docs/CD/B28359_01/AppDev.111/b28369/xdb10pls.htm

    Kind regards
    Anuj

  • fill out question of XML attributes

    I've got an XML file like this:

    As you can see, I have two packages.  I was able to get Labview to read in an array of child node two, but now how do I read in the attribute as an array or a collection of record for each 'proto' and then get the data only.  For example, I would like to retrieve data from the #2 package and it should produce a "EF: AA:FB:0. "C: 0d", how can I do this?  I know how to retrieve a single xml file, but get to the part of the attribute is a bit difficult here.  Thank you

    Oh!  This one is new for LV9.  I'm sorry.  Here is a variation using .NET (next you tell me are you on Mac).

  • to retrieve data from xml data type

    Hello...
    I have a doubt in the oracle database... Here's how to retrieve data from xml data type?

    Like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
    3 4 toMonth5 5 ctTestPan1 6 costType2 7 toYear2012 8 fromMonth12 9 fromYear2011 10 11
    ') as xml from dual) 12 -- 13 -- end of sample XMLDATA, use below query on your own table etc. as required 14 -- 15 select x.* 16 from t 17 ,xmltable('/DETAILS/FIELDS_VALUES/FIELD' 18 passing t.xml 19 columns name varchar2(30) path './NAME' 20 ,val varchar2(10) path './VALUE' 21* ) x SQL> / NAME VAL ------------------------------ ---------- toMonth 5 ctTestPan 1 costType 2 toYear 2012 fromMonth 12 fromYear 2011 6 rows selected.
  • I don't have my key code for windows. My dealer doesn't have either. How can I retrieve the key code number?

    I don't have my key code for windows (registration card was not with the computer when I bought it).  My carrier apparently deleted the key during my computer repair code.  My retailer where I purchased the computer didn't either.  How can I retrieve my key code number?

    The Windows product key is usually displayed on the sticker on the underside of the computer.

    However, you can also get it by running the Belarc Advisor or the Magic Jellybean Key Finder.

    Google for one of those and you will find them.

  • How to normalize/linearize whitspace in XML attributes?

    Hello

    I have data in a CLOB column I need to appeal to an XML attribute. The data may contain CR, LF and tabs - that the XML must be preserve way standardized/linearized (that is to say using & #10; & #13; etc.)

    I tried using XMLROOT - it deletes the line a total break.

    I tried to use XMLSERIALIZE - when finished with clause VERSION it also suppresses the newline, when without the VERSION, it keeps the jump line but not standardized.

    Do not use these preserves the jump line - but not standardized.

    Is there a bed in order to standardize XML - or should I use replace nested?

    Examples below.

    Thanks in advance.

    SQL> set long 20000
    SQL> set lines 1000
    SQL> set pages 1000
    SQL> select * from v$version
    
    
    BANNER                                                                          
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    
    PL/SQL Release 11.2.0.3.0 - Production                                          
    CORE 11.2.0.3.0 Production                                                      
    TNS for Linux: Version 11.2.0.3.0 - Production                                  
    NLSRTL Version 11.2.0.3.0 - Production                                          
    
    
    5 rows selected.
    SQL> -- as XMLTYPE, newline (chr(10)) is preserved, but not normalized
    SQL> select XMLELEMENT("A",
            XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                     )
    from dual
    
    
    XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))
    ---------------------------------------------------------
    <A ID="1" TXT="2                                         
    3"></A>                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> -- as CLOB, newline (chr(10)) is preserved, but not normalized
    SQL> select XMLELEMENT("A",
            XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                     ).getclobval()
    from dual
    
    
    XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")).GETCLOBVAL()
    ----------------------------------------------------------------------
    <A ID="1" TXT="2                                                      
    3"></A>                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> -- with XMLROOT - newline is removed
    SQL> select XMLROOT(
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      ),
                   VERSION '1.0')
    from dual
    
    
    XMLROOT(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),VERSION'1.0')
    -------------------------------------------------------------------------------
    <?xml version="1.0"?>                                                          
    <A ID="1" TXT="2 3"/>                                                          
                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> --with XMLSERIALIZE without VERSION clause - newline is preserved but not normalized
    SQL> select XMLSERIALIZE(DOCUMENT
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      )
                       )
    from dual
    
    
    XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")))
    -------------------------------------------------------------------------------
    <A ID="1" TXT="2                                                               
    3"></A>                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    SQL> --with XMLSERIALIZE with VERSION clause - newline is removed
    SQL> select XMLSERIALIZE(DOCUMENT
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      )
                       VERSION '1.0')
    from dual
    
    
    XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))VERSION'1.0')
    -------------------------------------------------------------------------------------------
    <A ID="1" TXT="2 3"/>                                                                      
    1 row selected.
    SQL> --doing replace works, but seems "un-natural" and very inefficient
    SQL> select replace(
            XMLELEMENT("A",
             XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                      ),
            chr(10),'&#10;')
    from dual
    
    
    REPLACE(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),CHR(10),'&#10;')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <A ID="1" TXT="2&#10;3"></A>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1 row selected.
    

    Question still pending, if anyone has another way - or knows for sure replace is the only option.

    Replaces nesting calls is probably the only option, of course, but not the way you have tried in your examples.

    Do replace it at an earlier stage, directly on the data source.

    Here's how I'd do:

    SQL> set define off
    SQL>
    SQL>
    SQL> select xmlserialize(document
      2           xmlelement("A",
      3             xmlattributes(noentityescaping
      4               1 as id
      5             , replace(
      6                 dbms_xmlgen.convert('X'||chr(10)||'Y')
      7               , chr(10)
      8               , '
    '
      9               ) as txt
     10             )
     11           )
     12           no indent
     13         )
     14  from dual ;
    
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    --------------------------------------------------------------------------------
    
    

    1. use DBMS_XMLGEN. CONVERT to handle reserved characters.

    2-using REPLACE to manage a specific entity escape

    Option NOENTITYESCAPING 3 - use to keep the entity references comes to be presented

  • How to handle xml attributes?

    Hallo,

    I am new to Livecycle and I have some difficulties to understand how reading/identification of the attributes XML in LiveCycle Designer.

    If I drag-and - drop items (#data of display data), they appear without problems. But if I drag an attribute (@attributename) they always show the empty to the PDF.

    For example, I have an XML file that looks like this:

    < product >

    ....

    < price >

    < ParamPrice visible = "true" >

    < prixUn visible = "false" > 1.350,00 < / prixUn >

    < priceB visible = "true" > 1.350,00 < / priceB >

    < price visible = "true" > 20.00 < / price >

    < price visible = "false" > 0,00 < / price >

    < / if >

    < NouveauPrix visible = "true" >

    < prixUn visible = "false" > 1.350,00 < / prixUn >

    < priceB visible = "true" > 1.350,00 < / priceB >

    < price visible = "true" > 20.00 < / price >

    < price visible = "false" > 0,00 < / price >

    < / sonderpreise >

    < / price >

    ...

    < / product >

    I tried to link like this: price.oldprice. (visible.value == "true") .priceA, but it does not work.

    I can´t really find some good information about the manipulation of XML attribute in LiveCycle. Can you please help me or tell me where to find more information on this topic.

    Thank you!!!

    What about Kat

    It is not the relationship between the presence of the object property and your visible attribute to date.

    But you can use a script to create such a thing.

    Put this in the event layout: ready for a text field, you want to be hidden or shown depending on the value of the visible attributes.

    this.presence = this.dataNode.visible.value === "true" ? "visible" : "hidden";
    
  • How to remove the value of the XML attribute in the Indesign file with javascript

    Hi all

    How to remove the value of the XML attribute in the Indesign file.

    1.jpg

    What error is this?

    in any case try this as well (one another),

    var myDoc = app.activeDocument;
    attrDelete(myDoc);
    function attrDelete(elm)
    {
        for (var i = 0; i < elm.xmlElements.length; i++)
        {
            try{
                for(j=0; j
    

    Vandy

  • Unable to get XML attributes in elements with function XMLTABLE

    I cannot get attributes of an XML stored in an XMLTYPE column.  The XML uses primarily attributes rather than items with a value of tag/matching.  If I put the knot in the first argument of the function XMLTABLE, he shoots the attribute at this level.  However, when I try to retrieve the attributes of the child node, I don't get the attribute values.  I'm working on the 11.2.0.3.0 Oracle database version.

    This is the create/insert statements:

    CREATE TABLE XML_TBL_TEST

    (

    ID NUMBER,

    XMLTYPE data

    );

    INSERT INTO XML_TBL_TEST

    VALUES (1, xmltype ("< user >

    < username = "Name1" >

    <>projects

    < Project = '100' QId OpId = PName "101" = "PName1" >

    < group >

    < group GName = "GName1" >

    elements <>

    < point OName = "OName1" Type = "Type1" >

    < ops >

    < op PType = material 'PType1' = 'Mat1"series = PStyle"Series1"="PStyle1">

    < options >

    < name of option = "Name1" Value = "V1" / >

    < name of option = "Name2" Value = "V2" / >

    < name of option = "Name3" Value = "V3" / >

    < / options >

    < /op >

    < op PType = material 'PType2' = 'Mat2"series = PStyle"Series2"="PStyle2">

    < options >

    < option Name = "Conjoint4" Value = "V4" / >

    < name of option = "Name5" Value = "V5" / >

    < option Name = "Name6" Value = "V6" / >

    < / options >

    < /op >

    < / ops >

    < / point >

    < point OName = "OName2" Type = "Type2" >

    < / point >

    < / object >

    < / Group >

    < group GName = "GName2" >

    < point OName = "OName3" Type = "Type3" >

    < / point >

    < / Group >

    < / group >

    < / project >

    < OpId project = "200" QId = "201" PName = "PName2" >

    < / project >

    < / project >

    < / user >

    < username = "Name2" >

    < / user >

    < username = "Name3" >

    < / user >

    ((< / user > '));

    The query below will draw the Name attribute in the element of the user but not the OpId, QId and PName attributes on the child of the Project element.

    SELECT x.*

    OF XML_TBL_TEST t.

    XMLTABLE (-with xmlnamespaces ('http://www.w3.org/2001/XMLSchema-instance' as "xsi"), )

    "/ Users/user.

    PASSAGE t.data

    COLUMNS - ID FOR ORDINALITE 'ID,' NUMBER

    Name VARCHAR2 (30) PATH "@Name."

    PATH of VARCHAR2 (30) PName ' / Projects/Project/@PName',

    QId NUMBER PATH ' / Users/User/Projects/Project/@QId' by DEFAULT 0,

    OpId NUMBER PATH '. (/ Project/@OpId' 0 by DEFAULT) x;

    The following query will get OpId, QId and PName attributes in the child project item.

    SELECT x.*

    OF XML_TBL_TEST t.

    XMLTABLE (-with xmlnamespaces ('http://www.w3.org/2001/XMLSchema-instance' as "xsi"), )

    "/ Users/user/projects/Project.

    PASSAGE t.data

    COLUMNS - UserName VARCHAR2 (30) PATH "@Name."

    PName VARCHAR2 (30) PATH "@PName."

    QId NUMBER PATH "@QId" default 0,

    OpId NUMBER PATH "@OpId" DEFAULT 0) x;

    How can I get all the attributes for a given element in the XML document.  I tried a number of options without success.

    FYI, SM

    Because there may be several projects under a user, you must use a 2nd XMLTABLE chained (or a more complex XQuery expression) to retrieve the attributes of two orders:

    SQL > SELECT / * + no_merge (x 1) * /.

    2 x 1. Username, x2.*

    Xml_tbl_test 3 t

    4, XMLTABLE)

    5 "/ users/user.

    6 in PASSING t.data

    7 COLUMNS

    Username 8 VARCHAR2 (30) PATH '@Name '.

    9, XMLType PATH "Projects/Project" projects

    (10) x 1

    11, XMLTABLE)

    12 "/ project".

    13 by the WAY x 1. Projects

    14 COLUMNS

    NUMBER 15 QId PATH '@QId '.

    16, ROAD NUMBER OpId '@OpId '.

    17, PName VARCHAR2 (30) PATH '@PName '.

    (18) (+) x 2

    19;

    QID OPID PNAME USERNAME

    ------------------------------ ---------- ---------- ------------------------------

    Name1 PName1 101 100

    Name1 PName2 201 200

    NAME2

    NAME3

    NB: I used the trick no_merge because of a bug in my version (11.2.0.4)

  • Retrieving values from XML in Oracle 9i - part II

    Hello

    regarding my previous post retrieving values of XML in Oracle 9i , I now have a different requirement.

    Assuming that the XML is as follows:

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < GenericRequest xmlns =" http://webservices.mysite.com/test "xmlns:ns =" " http://webservices.mysite.com/test/NS "xmlns:ns1 =" " http://webservices.mysite.com/test/ns1 "xmlns:ns2 =" " http://webservices.mysite.com/test/ns2 ">

    < ns1:order >

    < ns1:orderItems >

    < ns1:orderItem >

    create < ns1:operation > < / ns1:operation >

    < ns1:brickId > TST002 < / ns1:brickId >

    < ns1:brickAttributes >

    < ns1:attribute >

    < ns2:name > COUNTRY < / ns2:name >

    < ns2: value > U.S. < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CUST_ID < / ns2:name >

    < ns2: value > 12345 < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CITY < / ns2:name >

    < ns2: value > New York < / ns2: value >

    < / ns1:attribute >

    < / ns1:brickAttributes >

    < / ns1:orderItem >

    < ns1:orderItem >

    Update < ns1:operation > < / ns1:operation >

    < ns1:brickId > TST001 < / ns1:brickId >

    < ns1:brickAttributes >

    < ns1:attribute >

    < ns2:name > COUNTRY < / ns2:name >

    < ns2: value > U.S. < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CUST_ID < / ns2:name >

    < ns2: value > 22222 < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CITY < / ns2:name >

    < ns2: value > Los Angeles < / ns2: value >

    < / ns1:attribute >

    < / ns1:brickAttributes >

    < / ns1:orderItem >

    < / ns1:orderItems >

    < / ns1:order >

    < / GenericRequest >

    As you can now see the XML contains several elements of the order. For each agenda item, I have a single operation and a brick_id. Then, for each item on the agenda, I have a list of brickAttributes (name and value).

    How can I get something like that?

    OPERATION BRICK_ID NAME VALUE

    --------- -------- ------- -----------

    create TST002 COUNTRY WE

    create TST002 CUST_ID 12345

    create TST002 New York CITY

    update of TST001 COUNTRY United States

    Update TST001 CUST_ID 22222

    Update TST001 CITY Los Angeles

    Version of database is 9.2.0.8

    SELECT * FROM version of v$.

    BANNER

    ----------------------------------------------------------------

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production

    PL/SQL Release 9.2.0.8.0 - Production

    CORE Production 9.2.0.8.0

    AMT for HP - UX: 9.2.0.8.0 - Production Version

    NLSRTL Version 9.2.0.8.0 - Production

    Kind regards.

    Alberto

    Response of Odie, result is that extend

    with sample_data as (
    select xmltype(
    '
    
              
                
                  
                    create
                    TST002
                    
                      
                        COUNTRY
                        US
                      
                      
                        CUST_ID
                        12345
                      
                      
                        CITY
                        New York
                      
                    
                  
                  
                    update
                    TST001
                    
                      
                        COUNTRY
                        US
                      
                      
                        CUST_ID
                        22222
                      
                      
                        CITY
                        Los Angeles
                      
                    
                  
                
              
    ') xmldoc
    from dual
    )
    select extractvalue(value(x), 'ns1:orderItem/ns1:operation', 'xmlns:ns1="http://webservices.mysite.com/test/ns1"') as operation
         , extractvalue(value(x), 'ns1:orderItem/ns1:brickId', 'xmlns:ns1="http://webservices.mysite.com/test/ns1"') as brick_id
         , extractvalue(value(y), 'ns1:attribute/ns2:name', 'xmlns:ns1="http://webservices.mysite.com/test/ns1", xmlns:ns2="http://webservices.mysite.com/test/ns2"') as name
         , extractvalue(value(y), 'ns1:attribute/ns2:value', 'xmlns:ns1="http://webservices.mysite.com/test/ns1", xmlns:ns2="http://webservices.mysite.com/test/ns2"') as value
    from sample_data t
       , table(
           xmlsequence(
             extract(
               t.xmldoc
             , '/GenericRequest/ns1:order/ns1:orderItems/ns1:orderItem'
             , 'xmlns="http://webservices.mysite.com/test", xmlns:ns1="http://webservices.mysite.com/test/ns1"'
             )
           )
         ) x
       , table(
           xmlsequence(
             extract(
               value(x)
             , 'ns1:orderItem/ns1:brickAttributes/ns1:attribute'
             , 'xmlns:ns1="http://webservices.mysite.com/test/ns1"'
             )
           )
         ) y
    ;
    

    As shown, it simply retrieves to a higher level object that repeats once in table x and happening at the table there, which returns the expandable nodes.  The join is managed by value (x) in the second simple table.  It assumes that there is always 1 or several nodes of ns1:attribute in each ns1:orderItem.

  • Re: How to get a key of Microsoft Office if already installed?

    Hello world

    Here me again. My open windows freezing, and after a few attempts to fix it I decided to reinstall. I have the original Windows disk and rivers, but I don't want to lose Microsoft Office does not have the product key. So my question how do I get it from the installed Os. Any ideas appreciated. Thank you

    Hello

    If you do a search on Google, you will find a large number of programs to retrieve product key. Like windows and Office (shareware) product or ProduKey v1.42 key recovery

  • How to remove several Favorites in safari?

    Hi, I was wondering how to remove several Favorites in Safari because I accidentally added thousands of bookmarks.

    To remove several items in Favorites, I'll

    1. Select 'Edit bookmarks' in the menu 'Favorites '. -This shows real bookmark tree structure using the window in the current tab.
    2. View, you can click the triangle to the left of the sub folder name to expand / corrupts.
    3. Then select items to remove using the click, shift-click, or order, etc..
    4. Tap the DELETE key or select "Delete" from the menu "Edit".
    5. Repeat step 2 to 4 for all items you want to delete.

    In the bookmarks view, you can also use drag - move to reorder items.

    After cleaning, you can close the window/tab or just start normal web browsing in the same way as the other web site of switching.

  • No idea: sudden failure of several keys on the wireless keyboard

    Hello, I use a wireless keyboard HP, M/N on the back said SK-2060, but this site does not recognize as a model number, so I'm not entirely sure what keyboard model number it is.

    The keyboard has been working well for months, more than a year by this question, I think. Just this morning several key of all isn't on me at the same time, and they are all in the same area. O, 9, f7, and f8 keys are not admissible. I have read some things and thought it might be a driver problem, I uninstalled the drivers for my keyboard and the keyboard no longer works, I re-plugged my wireless adapter and it re-installed the drivers and the keyboard is working again. All the broken keys still don't work.

    I don't think it's a hardware problem, none of the buttons seem as if something is stuck sub, or obstructed in any way. All of them worked very well last night, now they have suddenly stopped and they are all in the same general area of the keyboard.

    I was wondering if someone could help understand me what went wrong, or how I might be able to fix it.

    I have a new keyboard for the moment, but it is not as comfortable as the keyboard HP that I use, and I would be able to fix it if I could.

    Thanks for your time, read this

    Troaves

    Sorry, but HP does not have much info on your keyboard: http://support.hp.com/us-en/product/HP-Wireless-C7000-Desktop/5197687/model/5197688

    Here are a few troubleshooting steps you can try: HP PC - keyboard and wireless mouse troubleshooting | HP® customer support

    Good luck

  • Lost admin password, how to retrieve the current password to change it?

    I forgot my Admin password, I connect on my laptop using the scanner print finger all the time and when I try to change the password for Admin it ask the password which I do not remember. How to retrieve the current password and change it in Windows 7 Home premium?

    It's a laptop Acer 5738 G

    You can change your current password as follows:

    1. click on start.
    2. type the three letters cmd in the search box.
    3. press on Ctrl + Shift + Enter
    4. click on "run as Administrator".
    5. type the following command and press ENTER after each:
    NET user "user %%nom" 123456

    Now the password is 123456. While dealing with accounts and passwords: having a single admin account on a PC is about the same as having a unique key for your car. What happens if you lose? He lost? Break it? A robust Windows Setup requires at least the following:

    • Two admin accounts fully tested, with their passwords to record on paper.
    • A password key file. Click Start / Help, then search for help on "password". Follow the instructions to create a key on your USB flash drive file so that you'll never find yourself in this uncomfortable situation.

Maybe you are looking for