Compare the values of the XMLType column to two different lines using XMLDiff in GR 11, 2

I have a table of data with a row of XMLType and I need a way to compare the XML data against the other. I guess I could use a function and return a XMLDIFF base output to the caller, but the function logic is a bit fuzzy. Would be nice to format the output finally in a table format.

I looked on http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions241.htm#SQLRF20025 and output in a format of table as shown in Re: how to find compare and identify between xmldocs .

I ran across some examples do not explain the best way to compare the XML code that is in the best performing XMLType column.

Any help would be appreciated.

Are you referring to different rows in the same table or different tables or?

Basically, you need to change the example of Odie so that the XMLDiff retrieves the XML from places in Pb, say something like

XMLDIFF(SELECT aXml FROM table WHERE ...,
        SELECT bXml FROM table WHERE ...)

This allows to avoid bringing the XML of the DB in the client code.

Don't know if that's what you're looking for, but hopefully it helps a little.

Tags: Oracle Development

Similar Questions

  • The xmltype column search and listing content in relational format

    Hi all

    I have a database of GR 11, 1 subject table containing the xmltype column. I'm writing a query that displays conetents xml in a relational format.
    SQL*Plus: Release 11.1.0.7.0 - Production on Thu Jan 17 11:45:06 2013
    
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Release 11.1.0.7.0 - 64 bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE Production 11.1.0.7.0
    AMT for 64-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    SQL > BULKMESSAGES Desc;
    Name of Type Null
    --------------- ---- -------------
    TRANSFER_ID VARCHAR2 (100)
    TRANSFER_LOGS XMLTYPE()
    TRANSFER_RESULT VARCHAR2 (10)

    SQL > select * from BULKMESSAGES
    where TRANSFER_RESULT = "REFUSED."
    /
    TRANSFER_ID TRANSFER_LOGS TRANSFER_RESULT
    ---------------- ---------------------------------------------------------------- ---------------
    T3217 < env:Envelope xmlns:env = 'http://www.w3.org/2003/05/soap-envelope' > REJECTED



    Column of xmltype TRNASFER_LOGS stores the SOAP responses. Response SOAP sample (dummied) of the TRANSFER_LOGS xml column is below:
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
         <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>
         <env:Body xmlns:env="http://www.w3.org/2003/05/soap-envelope">
              <env:Fault xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                   <env:Code xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                        <env:Value xmlns:env="http://www.w3.org/2003/05/soap-envelope">env:Receiver</env:Value>
                        <env:Subcode xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                             <env:Value xmlns:fault="http://www.es.com/soapfaults" xmlns:env="http://www.w3.org/2003/05/soap-envelope">fault:MessageBlocked</env:Value>
                        </env:Subcode>
                   </env:Code>
                   <env:Reason xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                        <env:Text lang="en" xmlns:env="http://www.w3.org/2003/05/soap-envelope">connection rejected</env:Text>
                   </env:Reason>
                   <env:Detail xmlns:fault="http://www.es.com/soapfaults" fault:type="faultDetails" fault:messageId="0000013a6" xmlns:env="http://www.w3.org/2003/05/soap-envelope">
                        <fault:path policy="Request Message">
                             <fault:filter status="Fail" name="Call 'Process request '">
                                  <fault:path policy="Process xml ">
                                       <fault:filter status="Fail" name="Call 'Call 3rdparty service'">
                                            <fault:path policy="Call external service">
                                                 <fault:filter status="Pass" name="Extract message"/>
                                            </fault:path>
                                       </fault:filter>
                                  </fault:path>
                             </fault:filter>
                        </fault:path>
                        <fault:attributes>
                             <fault:attribute name="monitoring.enabled" value="true"/>
                             <fault:attribute name="requestor" value="none"/>
                             <fault:attribute name="circuit.failure.reason" value="connection rejected"/>
                             <fault:attribute name="message_protocol" value="SOAP"/>
                             <fault:attribute name="user_id" value="31274556"/>
                             <fault:attribute name="ws_name" value="PUSHDOC"/>
                             <fault:attribute name="user.enabled" value="N"/>
                             <fault:attribute name="http.request.clientaddr" value="/10.254.123.44:43840"/>
                             <fault:attribute name="soap_action" value="pushDocument"/>
                             <fault:attribute name="message.reception_time" value="1349769769742"/>
                             <fault:attribute name="user.api_logging_flag" value="Y"/>
                             <fault:attribute name="circuit.exception" value="com.es.circuit.CircuitAbortException: connection rejected"/>
                             <fault:attribute name="end_point" value="https://es.live.com/pdfs"/>
                             <fault:attribute name="message.protocol.type" value="http"/>
                             <fault:attribute name="user.incoming_date" value="09-11-2013 09:02:49"/>
                             <fault:attribute name="http.destination.host" value="es.live.com"/>
                             <fault:attribute name="message.local.address" value="/100.25.40.82:8085"/>
                             <fault:attribute value="N"/>
                        </fault:attributes>
                   </env:Detail>
              </env:Fault>
         </env:Body>
    </env:Envelope>
    My goal is to search for documents TRANSFER_LOGS for lines that contain flaws: attribute name = "circuit.exception". Then report "fault: name attribute" and their values in relational format. For example:
    TRANSFER_ID    TRANSFER_RESULT FAULT_FAIL_REASON    FAULT_CIRCUIT_EXCEPTION                               FAULT_WS_NAME   FAULT_DESTINATION_HOST
    ----------     --------------- ----------------     -------------------------------------------------------- -------------   ---------------------
    T3217          REJECTED       CONNECTION REJECTED  com.es.circuit.CircuitAbortException: connection rejected  PUSHDOC       es.live.com
    I am new to oracle XML sql querying. Documents in the column of xmltype TRANSFER_LOGS have many namespaces and the query I've tried does not work. So, any help or pointers to search and extract TRANSFER_LOGS in above format is greatly appreciated.

    Thanks in advance.

    VC

    Hello

    You can use something like this:

    SQL> select t.transfer_id, t.transfer_result, x.*
      2  from bulkmessages t
      3     , xmltable(
      4         xmlnamespaces(
      5           'http://www.w3.org/2003/05/soap-envelope' as "e"
      6         , 'http://www.es.com/soapfaults' as "f"
      7         )
      8       , '/e:Envelope/e:Body/e:Fault/e:Detail/f:attributes'
      9         passing t.transfer_logs
     10         columns
     11           FAULT_FAIL_REASON       varchar2(200) path 'f:attribute[@name="circuit.failure.reason"]/@value'
     12         , FAULT_CIRCUIT_EXCEPTION     varchar2(200) path 'f:attribute[@name="circuit.exception"]/@value'
     13         , FAULT_WS_NAME           varchar2(200) path 'f:attribute[@name="ws_name"]/@value'
     14         , FAULT_DESTINATION_HOST  varchar2(200) path 'f:attribute[@name="http.destination.host"]/@value'
     15         ) x
     16  where xmlexists(
     17         'declare namespace e = "http://www.w3.org/2003/05/soap-envelope"; (: :)
     18          declare namespace f = "http://www.es.com/soapfaults"; (: :)
     19          /e:Envelope/e:Body/e:Fault/e:Detail/f:attributes/f:attribute[@name="circuit.exception"]'
     20          passing t.transfer_logs
     21        ) ;
    
    TRANSFER_ID     TRANSFER_RESULT FAULT_FAIL_REASON        FAULT_CIRCUIT_EXCEPTION                                       FAULT_WS_NAME    FAULT_DESTINATION_HOST
    --------------- --------------- ------------------------ ------------------------------------------------------------- ---------------- -------------------------
    T3217           REJECTED        connection rejected      com.es.circuit.CircuitAbortException: connection rejected     PUSHDOC          es.live.com
     
    

    Or, more simply:

    SQL> select t.transfer_id, t.transfer_result, x.*
      2  from bulkmessages t
      3     , xmltable(
      4         xmlnamespaces(
      5           'http://www.w3.org/2003/05/soap-envelope' as "e"
      6         , 'http://www.es.com/soapfaults' as "f"
      7         )
      8       , '/e:Envelope/e:Body/e:Fault/e:Detail/f:attributes'
      9         passing t.transfer_logs
     10         columns
     11           FAULT_FAIL_REASON       varchar2(200) path 'f:attribute[@name="circuit.failure.reason"]/@value'
     12         , FAULT_CIRCUIT_EXCEPTION     varchar2(200) path 'f:attribute[@name="circuit.exception"]/@value'
     13         , FAULT_WS_NAME           varchar2(200) path 'f:attribute[@name="ws_name"]/@value'
     14         , FAULT_DESTINATION_HOST  varchar2(200) path 'f:attribute[@name="http.destination.host"]/@value'
     15         ) x
     16  where x.FAULT_CIRCUIT_EXCEPTION is not null ;
    
    TRANSFER_ID    TRANSFER_RESULT FAULT_FAIL_REASON      FAULT_CIRCUIT_EXCEPTION                                      FAULT_WS_NAME      FAULT_DESTINATION_HOST
    -------------- --------------- ---------------------- ------------------------------------------------------------ ------------------ --------------------------
    T3217          REJECTED        connection rejected    com.es.circuit.CircuitAbortException: connection rejected    PUSHDOC            es.live.com
      
    
  • What is the default size of the XMLType column?

    I have a table with 1 type of crude and 1 XMLType column. In the XMLType column I'm inserting XML, more

    < ocaStatus xmlns = "http://xmlbeans.apache.org/ocastatus" >
    < status >
    < > 990 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2010 - 01 - 19 < / statusDate >
    < user name > OcaNimsAcf < / userId >
    < comment > DocumentnotinNIMS < / comment >
    < / status >
    < status >
    < > 990 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2010 - 01 - 19 < / statusDate >
    < user name > OcaNimsAcf < / userId >
    < comment > DocumentnotinNIMS < / comment >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 29 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 29 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 28 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 28 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 27 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 26 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 25 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < statusCode > 306 < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 04 - 21 < / statusDate >
    < user name > u0075970 < / userId >
    < / status >
    < status >
    < > 301 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 02 - 05 < / statusDate >
    < user name > DMS_WORKFLOW < / userId >
    < comment > < / comment >
    < / status >
    < status >
    < > 990 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2010 - 01 - 17 < / statusDate >
    < user name > OcaNimsAcf < / userId >
    < comment > Comparedfornimsacf < / comment >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 09 - 16 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 29 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 29 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 28 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 28 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 27 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 26 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 25 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 22 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 21 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < > 501 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 08 - 20 < / statusDate >
    < user name > oca_scheduled_job < / userId >
    < / status >
    < status >
    < statusCode > 306 < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 04 - 21 < / statusDate >
    < user name > u0075970 < / userId >
    < / status >
    < status >
    < > 301 statusCode < / statusCode >
    < statusDateclass = "sql-date' > 2008 - 02 - 05 < / statusDate >
    < user name > DMS_WORKFLOW < / userId >
    < comment > < / comment >
    < / status >
    < / ocaStatus >

    The XML is very long. For insertion in the table, I use xmlparse() function to get XMLType.
    While doing this I'm ORA-01704: string literal too long error. It is said can accommodate maximum 4,000 characters.
    I guess that XMLType is stored as a default CLOB. So it should allow more than 4000 characters.
    How can I store data xml with more than 4000 characters.

    Thank you.

    XMLParse is a SQL function, you cannot use a string literal is longer than 4000 characters.

    Instead, you can declare a PL/SQL VARCHAR2 variable, which can contain up to 32 k characters and use the XMLType constructor:

    DECLARE
    
     xmlstr VARCHAR2(32767) := '';
     xmldoc xmltype;
    
    BEGIN
    
     xmldoc := xmltype(xmlstr);
     INSERT INTO your_table(xml_data) VALUES(xmldoc);
    
    END;
    

    For strings longer than 32 k, you may need to load it from a file.

  • ADF and the use of the XMLType columns

    After discovering the Jdeveloper 11 g was able to generate business components/data controls for complex web services (see this tutorial excellet http://www.oracle.com/technology/tech/fmw4apps/agile/pdf/adf11g-agile.pdf), I assumed that jdev 11 g should now have the same capacity on XMLtype columns with a registered scheme, and was therefore a good match for our enforcement objectives be able to edit
    parts of an XML document to aid in the face of components and Assembly/store the document in a way centic document in a relational/XML database XMLType column hybrid.

    I tested this point, has created a table with an XMLType column binary, saved the schema in database (11g) and jdev(11g) and generated my components.


    I was very disappointed at the discovery of the structure of data controls stops at the level of the attribute in the table (ie the XMLType column), so none of the structure of the XML document is revealed or can be used in a meaningful way through data control.

    Am I missing something here? should not control data generated reveal the XML structure and allow the use of components of forms/table faces on some parts of the structure of the document? I'm not a java programmer, so was really hoping to do this with data not generated controls beans not.

    If it is just to treat it as a CLOB, what's the point of registered xsd schemas?

    Yes, it is through java. Sorry

  • Help - query on the XMLType column?

    Hello

    Please could someone help me to write a query to extract data from XMLType column in the script below:

    Here is my example of WHAT XML stored in the XMLType column:
     <?xml version="1.0" encoding="UTF-8"?>
    <cf:IncidentReportGroup xmlns:cf="http://xml.crossflo.com/jxdm/3.0.3"
    xmlns:j="http://www.it.ojp.gov/jxdm/3.0.3" xmlns:ext="http://xml.crossflo.com/jxdm/3.0.3/extension"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:i="http://www.it.ojp.gov/jxdm/appinfo/1">
        <cf:IncidentReport>
            <ext:Incident>
                <j:ActivityID>
                    <j:ID>99999999999999</j:ID>
                </j:ActivityID>
                <j:ActivityDate>2007-01-13</j:ActivityDate>
                <j:ActivityTime>01:25:00Z</j:ActivityTime>
            </ext:Incident>
        </cf:IncidentReport>
    </cf:IncidentReportGroup>
    I want to retrieve ActivityDate and ActivityTime where ActivityID/ID = 'something'...

    Here is the example query I wrote but no luck:
    SELECT extractValue(xml_doc, '/cf:IncidentReport/ext:Incident/j:ActivityDate','/cf:IncidentReport/ext:Incident/j:ActivityTime')
      FROM TABLEA 
      where existsNode(xml_doc,'/cf:IncidentReport/ext:Incident/j:ActivityID[j:ID="99999999999999"]')
     
    SQL>  var ID varchar2(20)
    
    SQL>  exec :ID := '99999999999999'
    PL/SQL procedure successfully completed.
    
    SQL>  with t as (
     select xmltype('
    
        
            
                
                    99999999999999
                
                2007-01-13
                01:25:00Z
            
        
    ') xml from dual
    )
    select t2.*
      from t t, xmltable(xmlnamespaces('http://xml.crossflo.com/jxdm/3.0.3/extension' as "ext",
                                       'http://www.it.ojp.gov/jxdm/3.0.3' as "j"),
                         'ext:Incident[j:ActivityID/j:ID=$ID]'
                         passing t.xml.extract('//ext:Incident','xmlns:ext="http://xml.crossflo.com/jxdm/3.0.3/extension"'),
                                 xmlelement(ID, :ID) as ID
                         columns ActivityID   varchar2(10) path 'j:ActivityID',
                                 ActivityDate varchar2(10) path 'j:ActivityDate',
                                 ActivityTime varchar2(10) path 'j:ActivityTime') t2
    /
    ACTIVITYID ACTIVITYDA ACTIVITYTI
    ---------- ---------- ----------
    9999999999 2007-01-13 01:25:00Z
    1 row selected.
    

    Published by: michaels2 on March 2, 2009 08:43

  • Lightroom 6 develop Mode.  Screen loupe and compare view after screen show blue background with two diagonal lines of tbrl top low right another top right at the intersection of criss left in the Center.  If I move to another photo, the program stops

    Lightroom 6 develop Mode.  Screen loupe and compare view after show blue background wallpaper with two diagonal lines left and top right side of the other top right at the crossroads criss left in the Center.  If I move to another photo, the program no longer works and ends by asking me to close the program. Help?

    Go to your Lightroom preferences, performance tab, uncheck the option of the graphics processor.

  • Comparing the same tables of two schemas

    I had already posted a similair on this thread. So, I thought I would start a new thread on this to avoid confusion

    I want to generate a report that shows the difference in the data type of the columns in the same table in two different patterns.

    The query using LESS shows the difference below.

    create table SCOTT.mytab1 (empid number);
    create table HR.mytab1 (empid varchar2(34));
    
    
    SELECT   table_name, column_name, OWNER schema, data_type
    FROM     dba_tab_cols where owner = 'SCOTT'
    AND TABLE_NAME = 'MYTAB1'
    MINUS
    SELECT   table_name, column_name, OWNER schema, data_type
    FROM     dba_tab_cols where owner = 'HR'
    AND TABLE_NAME = 'MYTAB1'
    
    Result:
    TABLE_NAME      COLUMN_NAME     SCHEMA     DATA_TYPE
    --------------- --------------- ---------- ------------
    MYTAB1          EMPID           SCOTT      NUMBER
    But, since it is a report, I want to see the form of results the two schemas that has column of different data types with the same names of table

    Expected results:
    TABLE_NAME      COLUMN_NAME     SCHEMA     DATA_TYPE
    --------------- --------------- ---------- ------------
    MYTAB1          EMPID           SCOTT      NUMBER
    MYTAB1          EMPID           HR         VARCHAR2
    Anyway I could do this?

    Why not get a single line with two types of data:

    select a.table_name, a.column_name, a.data_type schema1_type, b.data_type schema2_type
    from all_tab_columns a, all_tab_columns b
    where a.owner = 'SCOTT'
    and b.owner = 'HR'
    and a.table_name=b.table_name
    and a.column_name=b.column_name
    and a.data_type!=b.data_type;
    

    This extracted single query columns present on the two schemas but with different data types. These columns only on one of the two schemas are not extracted.

    Max

  • How to find the same column name in different tables in the same schema

    Hello

    I find the 'ename' column name in different tables in the same schema.

    Thank you
    Nr

    Hello

    Try this query

    Select column_name, table_name from user_tab_columns where column_name = 'ENAME ';

    Award points and end the debate, if your question is answered or mark if she was...

    Kind regards

    Lacouture.

  • Possible to define strategies of OAM configuration on the same site on two different

    Is it possible to define strategies of OAM configuration on the same site on two different servers?

    One of the sites to have anonymous access but it to be protected. How to set up a policy without it automatically applies to all Web sites that match regardless of the host.

    How to differentiate the two OAM sites so that I can apply security different strategies for each of them?

    Thank you.

    You can refer to this [recent thread | http://forums.oracle.com/forums/thread.jspa?threadID=878094&tstart=0].

    Also, if one of the sites requires anonymous access for all the content and it's not going to change in the foreseeable future, just don't install/activate webgate on that.

    -Vinod

  • To find common data in 2 columns from two different tables.

    Hello

    Could someone help me with a querry to discover common data of 2 columns from two different tables?

    Thank you
    Rajesh

    Try as below.

    select col1 ,col2 from tab1
    intersect
    select col1 ,col2 from tab2;
    
  • How to compare the unique column values

    Hi all

    I have data in following manner

    PAT_ID PAT_ENC_CSN_ID DEPT_ID EFFECTIVE_DATE

    Z369160557291136405500122 APRIL 14
    Z369160557291136405500222 APRIL 14
    Z269466457982980405500116 MAY 14
    Z269466457982980405500216 MAY 14
    Z268924357987777405500116 MAY 14
    Z268924357987777405500218 MAY 14

    My requirement is to know if the patient changes in another Department at the same time, so I need to select the patient or even dismiss the patient. In my example above, I have to select Z3691605 and Z2694664 patients and ignore the remaining patient.

    Can someone plase help me with the code for that sql. I use 11g.

    Hope I have my question clearly.

    Thank you.

    Here is a way use are:

    SQL > select *.

    2 t a

    3 where exists (select 1

    4t b

    5 where a.pat_id = b.pat_id

    6 and a.pat_enc_csn_id = b.pat_enc_csn_id

    7 and a.effective_date = b.effective_date

    8 and a.dept_id <> b.dept_id

    9                );

    PAT_ID PAT_ENC_CSN_ID DEPT_ID EFFECTIVE_DATE

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

    Z3691605 57291136 4055002 22 APRIL 2014 00:00:00

    Z3691605 57291136 4055001 22 APRIL 2014 00:00:00

    Z2694664 57982980 4055002 16 MAY 2014 00:00:00

    Z2694664 57982980 4055001 16 MAY 2014 00:00:00

  • Add to the XMLTYPE column

    Hello

    I have a requirement to insert a new XML tag in the existing XMLTYPE column.

    Oracle version: Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    create table rds_xml_config (module_name varchar2 (32), module_type varchar2 (100), config_xml xmltype);

    insert into rds_xml_config values ('TRANSMIT_SEQ', 'INTERFACE',' < transmit_seq > <!-file sequence number will be updated after each race-> < file = "RTP" Type_de_fichier > < file_seq_num > 2457 < / file_seq_num > < / file > < file Type_de_fichier = 'RTS' > < file_seq_num > 2453 < / file_seq_num > < / file > < Type_de_fichier = "RTL" file > < file_seq_num >) 2522 < / file_seq_num > < / file > < / transmit_seq > ');

    I have to add < file = "RTX" Type_de_fichier > < file_seq_num > 0 < / file_seq_num > < / file >.

    As a temporary work around, I used below the update statement.

    Update rds_xml_config

    Set config_xml =' < transmit_seq > <!-file sequence number will be updated after each race-> < file = "RTP" Type_de_fichier > < file_seq_num > 2457 < / file_seq_num > < / file > < file Type_de_fichier = 'RTS' > < file_seq_num > 2453 < / file_seq_num > < / file > < Type_de_fichier = "RTL" file > < file_seq_num > 2522 < / file_seq_num > < / file > < file = "RTX" file_type > < file_seq_num > 0 < / file_seq_num > < / file > < / transmit_seq > '

    WHERE module_type = "INTERFACE".

    AND module_name = "TRANSMIT_SEQ";

    SEQ numbers will be modified for each race of the file, so I cannot use the work temporary around during migration to production, have we a way to add new XMLtag.

    Thank you

    Rambeau

    Search in INSERTCHILDXML

    http://docs.Oracle.com/CD/B19306_01/server.102/b14200/functions066.htm

    SQL> select a.config_xml.extract('*') old_xml
      2       , insertchildxml(config_xml, '/transmit_seq', 'file',xmltype('10000')).extract('*') new_xml
      3    from rds_xml_config a;
    
    OLD_XML                                                                                              NEW_XML
    ---------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------
                                                                                           
                                                 
                                                                                     
        2457                                                                 2457
                                                                                                    
                                                                                     
        2453                                                                 2453
                                                                                                    
                                                                                     
        2522                                                                 2522
                                                                                                    
                                                                                            
                                                                                                             10000
                                                                                                           
                                                                                                         
    
  • Cannot load in the XMLTYPE column

    HI gentlemen,

    I have enormous difficulty with loading the XML content in an XMLTYPE column. Here's the annotated schemas:
    SQL> select any_path from resource_view where any_path like '%GKSADMIN/ICD%';
    
    ANY_PATH                                                                        
    --------------------------------------------------------------------------------
    /sys/schemas/GKSADMIN/ICD                                                       
    /sys/schemas/GKSADMIN/ICD/datentypen_V1.40.xsd                                  
    /sys/schemas/GKSADMIN/ICD/ehd_header_V1.40.xsd                                  
    /sys/schemas/GKSADMIN/ICD/ehd_root_V1.40.xsd                                    
    /sys/schemas/GKSADMIN/ICD/icd_body.xsd                                          
    /sys/schemas/GKSADMIN/ICD/icd_header.xsd                                        
    /sys/schemas/GKSADMIN/ICD/icd_root.xsd                                          
    /sys/schemas/GKSADMIN/ICD/keytabs_V1.40.xsd                                     
    
    8 Zeilen ausgewählt.
    And here's the relational table:
    SQL> describe icd
     Name                                      Null?    Typ
     ----------------------------------------- -------- ----------------------------
     ID                                                 CHAR(2)
     XML_DOCUMENT                                       SYS.XMLTYPE(XMLSchema "ICD/i
                                                        cd_root.xsd" Element "ehd") 
                                                        STORAGE Object-relational TY
                                                        PE "ICD$ICD_ROOT_TYP"
    Now, when I try to load a document instance (which proved OK with xmloracle), the following occurs:
    SQL> @loadxmlfileascolumn_int
    Geben Sie einen Wert für source_directory ein: c:\gks\kbv\c\icd\xml
    alt   1: create or replace directory SOURCE_DIR as '&source_directory'
    neu   1: create or replace directory SOURCE_DIR as 'c:\gks\kbv\c\icd\xml'
    
    Verzeichnis wurde erstellt.
    
    Geben Sie einen Wert für xmltypetable ein: icd
    alt   4:   INSERT INTO &XMLTypeTable
    neu   4:   INSERT INTO icd
    Geben Sie einen Wert für id ein: 01
    Geben Sie einen Wert für instancedocument ein: icdtest.xml
    alt   5:     VALUES (&id, XMLType(bfilename('SOURCE_DIR', '&InstanceDocument'),
    neu   5:     VALUES (01, XMLType(bfilename('SOURCE_DIR', 'icdtest.xml'),
    declare
    *
    FEHLER in Zeile 1:
    ORA-01830: Datumsformatstruktur endet vor Umwandlung der gesamten 
    Eingabezeichenfolge 
    ORA-06512: in Zeile 4 
    
    
    SQL> spool off
    Because the patterns are very big, I took only one to show the relevant parts:
        <ehd:document_type_cd V="ICD" DN="ICD-Stammdatei" S="1.2.276.0.76.5.100"/>
        <ehd:service_tmr V="2010-01-01..2010-12-31"/>
        <ehd:origination_dttm V="2009-11-10+01:00"/>
    Guilty is allegedly origination_dttm with its time zone. However, consider the resolution of type below that leads to XS: date. This should be able to accommodate the time zone as well.
         <!-- ************************ origination_dttm_typ ********************************* -->
         <xs:element name="origination_dttm" type="origination_dttm_typ">
              <xs:annotation>
                   <xs:documentation>Erstellungsdatum</xs:documentation>
              </xs:annotation>
         </xs:element>
         <xs:complexType name="origination_dttm_typ">
              <xs:complexContent>
                   <xs:extension base="v_date_typ"/>
              </xs:complexContent>
         </xs:complexType>
    
         v_date_typ: enthält nur den V-Attribut für einfache Datums-Angaben
    
         <!-- ************************ v_date_typ ********************************** -->
         <xs:complexType name="v_date_typ">
              <xs:attribute name="V" type="xs:date" use="required"/>
         </xs:complexType>
    When I delete the passage of time zone in the document instance, it works again.
    (However, another error will be reported then - another question.)

    Can you help me to know what is the problem? Is this my error or a bug?

    Thank you, best regards,.

    Miklós HERBOLY

    Published by: mh * July 3, 2011 10:55

    It's Oracle functionality (at least in 11g R2). See working with zones of the XML DB Developer's Guide: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16659/xdb05sto.htm#autoId62

    The chapter also includes an example how to adjust the schema with Oracle specific annotation.

    See also http://stackoverflow.com/questions/6370035/why-dbms-xmlschema-fails-to-validate-a-valid-xsdatetime/6382096#6382096

    Published by: 836290 on July 4, 2011 07:56

  • Creating indexes in the XMLType column

    Hello

    I have the following for XML document stored as an XMLType column.

    < ocaStatus xmlns = "http://xmlbeans.apache.org/ocastatus" > < status > < > 934 statusCode < / statusCode > < statusDate > Wed Apr 07 16:05:53 GMT + 05:30 2010 < / statusDate > < userId > u0121845 < / userId > < comment > sent to FLC < / comment > < / status > < status > < statusCode > 934 < / statusCode > < statusDate > Wed Apr 07 15:58:25 GMT + 05:30 2010 < / statusDate > < userId > u0121845 < / username > < Comment > sent to FLC < / comment > < / status > < status > < statusCode > 934 < / statusCode > < statusDate > Wed Apr 07 15:54:02 GMT + 05:30 2010 < / statusDate > < userId u0121845 > < / userId > < comment > sent to FLC < / comment > < / status > < status > < statusCode > 750 < / statusCode > < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate > < u0121845 userId > < / userId > < comment > metadata of the Document is correct. < / comment > < / status > < status > < statusCode > 934 < / statusCode > < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate > < userId > u0121845 < / userId > < comment > sent to FLC < / comment > < / status > < status > < statusCode > 932 < / statusCode > < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate > < userId > u0121845 < / username > < comment > loaded Novus < /. comment > < / status > < status > < > 700 statusCode < / statusCode > < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate > < userId u0121845 > < / userId > < comment > Document is deleted from the OCA. < / comment > < / status > < / ocaStatus >

    I created as a result of the clues in the XML
    CREATING INDEX 'OCA_DEV '. "' OCA_STATUS_CODE_INDEX ' ON 'OCA_DEV '. "DOCUMENT_STATUS_XML"(EXTRACTVALUE('/ocaStatus/status/statusCode'));
    CREATING INDEX 'OCA_DEV '. "' OCA_STATUS_DATE_INDEX ' ON 'OCA_DEV '. "DOCUMENT_STATUS_XML"(EXTRACTVALUE('/ocaStatus/status/statusDate'));

    However, the problem is that I will be having several status within each XML that violates the indexing.
    Is there a way I can still create indexes for multiple State values in each XML file?

    Thanks in advance.

    Hello

    Take a look at the manual xdb (which version do you use?), for the 10.2 version, see: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb04cre.htm#sthref596
    It describes how you can index an XMLTYPE. Because you describe how you use, take a look at your needs.

    In 11G, you have the XMLINDEX to xmltypes indexing, you will find information here: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb_indexing.htm#CHDFCGGI

    Herald tiomela
    Superconsult.nl

  • excerpt from the XMLType column

    In my XMLType column I'm storing XML content that is the xml below.

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

    < project >

    < basics >

    < attribute name = "Id" > 3197915 < / attribute >

    < attribute name = "Name" > 345 < / attribute >

    < attribute name = "Révision" / >

    < name of attribute 'Type' = > project < / attribute >

    < / basics >

    < relationship / >

    < children >

    < application >

    < basics >

    < name of attribute 'Type' = > Application < / attribute >

    < attribute name = "Name" > rty < / attribute >

    < = "Scope" attribute name > SCOPE_PROJECT < / attribute >

    < attribute name = "Révision" / >

    < attribute name = "Id" > 3197918 < / attribute >

    < / basics >

    < relationship type = "Project relationship Configuration" >

    < attribute name = "Subclassification subcomponent" / >

    < attribute name = 'Type of subcomponent' / >

    < attribute name = "Quantity" > 1 < / attribute >

    < attribute name = "Unit of measurement" / >

    < = "Scope" attribute name > SCOPE_PROJECT < / attribute >

    < attribute name = "Post number" / >

    < attribute name = "Additional Information" / >

    < / relationship >

    < children / >

    < / application >

    < typical >

    < basics >

    < name of attribute 'Type' = > rrrr < / attribute >

    < attribute name = "Name" > rrr_Mo < / attribute >

    < attribute name = "Id" > 944674 < / attribute >

    < = "Scope" attribute name > SCOPE_GLOBAL < / attribute >

    < attribute name = "Révision" / >

    < / basics >

    < children / >

    < / typical >

    < application >

    < basics >

    < name of attribute 'Type' = > Application < / attribute >

    < attribute name = "Name" > yu123 < / attribute >

    < = "Scope" attribute name > SCOPE_PROJECT < / attribute >

    < attribute name = "Révision" / >

    < attribute name = "Id" > 3197922 < / attribute >

    < / basics >

    < children / >

    < / application >

    < / children >

    < / project >

    How to write a query to extract the Application name?

    Here, it should return "anais" and "yu123".

    I'm using Oracle 11 g.

    Thanks in advance.

    Something like the following, where TMP_XML. DOC is my XMLType column:

    SQL> select x.*
      2  from tmp_xml t
      3     , xmltable('/Project/Children/Application/Basics'
      4         passing t.doc
      5         columns application_name varchar2(30) path 'Attribute[@Name="Name"]'
      6       ) x
      7  ;
    
    APPLICATION_NAME
    ------------------------------
    rty
    yu123
    

Maybe you are looking for