Select fields from XML in CLOB column

Hi,
I have the following XML stored in a table as CLOB field. What i want is to select specific fields into Relational Data.
<?xml version=1.0 encoding=UTF-8?>
<msgContext>
    <JMSHeaders xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">
        <jms1:JMSDeliveryMode>PERSISTENT</jms1:JMSDeliveryMode>
        <jms1:JMSTimestamp>1329217943352</jms1:JMSTimestamp>
        <jms1:JMSExpiration>0</jms1:JMSExpiration>
        <jms1:JMSRedelivered>false</jms1:JMSRedelivered>
        <jms1:JMSPriority>4</jms1:JMSPriority>
    </JMSHeaders>
    <OtherProperties>
        <auditPartnerId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">010000000001189CC2BC2C</auditPartnerId>
        <auditServiceId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">Auth</auditServiceId>
        <correlationTransactionId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">d0022064-1df3-43ef-be5b-93aedc96b3b2</correlationTransactionId>
        <auditReceivedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.346 +0100</auditReceivedDate>
        <auditStatus xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">ok</auditStatus>
        <auditForwardedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.351 +0100</auditForwardedDate>
        <auditMsisdn xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms"/>
        <auditEngineId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">dpNorthLog</auditEngineId>
        <ns0:auditInfo xmlns:ns0="http://www.tibco.com/schemas/Project_gig_reporting/tib_bw_reporting/Resources/Schemas/auditInfo.xsd">
            <ns0:dp-logpoint>response</ns0:dp-logpoint>
            <ns0:dp-target-url/>
            <ns0:dp-port>20565</ns0:dp-port>
            <ns0:dp-uri>/comp_am</ns0:dp-uri>
            <ns0:dp-size>1365</ns0:dp-size>
            <ns0:dp-replytoengine/>
        </ns0:auditInfo>
    </OtherProperties>
</msgContext>I tried to use the xml_query below with no luck :
SELECT  x.auditPartnerId,
             x.auditServiceId
   FROM source s
     , XMLTable(
         '/msgContext/OtherProperties'
          passing s.messagetext
          columns
          auditPartnerId   VARCHAR2(20) PATH 'auditPartnerId'
        , auditServiceId     VARCHAR2(20) PATH 'auditServiceId'
        ) x;Any help appreciated

alekons wrote:
Any help appreciatedYou will have to convert it to xmltype first. See below:
SQL> select * from v$version ;
BANNER
Oracle Database 10g Release 10.2.0.5.0 - Production
PL/SQL Release 10.2.0.5.0 - Production
CORE     10.2.0.5.0     Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
SQL> with src as ( select to_clob('<msgContext>
<JMSHeaders xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">
<jms1:JMSDeliveryMode>PERSISTENT</jms1:JMSDeliveryMode>
<jms1:JMSTimestamp>1329217943352</jms1:JMSTimestamp>
<jms1:JMSExpiration>0</jms1:JMSExpiration>
<jms1:JMSRedelivered>false</jms1:JMSRedelivered>
<jms1:JMSPriority>4</jms1:JMSPriority>
</JMSHeaders>
<OtherProperties>
<auditPartnerId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">010000000001189CC2BC2C</auditPartnerId>
<auditServiceId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">Auth</auditServiceId>
<correlationTransactionId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">d0022064-1df3-43ef-be5b-93aedc96b3b2</correlationTransactionId>
<auditReceivedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.346 +0100</auditReceivedDate>
<auditStatus xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">ok</auditStatus>
<auditForwardedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.351 +0100</auditForwardedDate>
<auditMsisdn xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms"/>
<auditEngineId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">dpNorthLog</auditEngineId>
<ns0:auditInfo xmlns:ns0="http://www.tibco.com/schemas/Project_gig_reporting/tib_bw_reporting/Resources/Schemas/auditInfo.xsd">
<ns0:dp-logpoint>response</ns0:dp-logpoint>
<ns0:dp-target-url/>
<ns0:dp-port>20565</ns0:dp-port>
<ns0:dp-uri>/comp_am</ns0:dp-uri>
<ns0:dp-size>1365</ns0:dp-size>
<ns0:dp-replytoengine/>
</ns0:auditInfo>
</OtherProperties>
</msgContext>') as messagetext from dual )
SELECT x.auditPartnerId,
x.auditServiceId
FROM src s
, XMLTable(
'/msgContext/OtherProperties'
passing s.messagetext
columns
auditPartnerId VARCHAR2(20) PATH 'auditPartnerId'
, AUDITSERVICEID VARCHAR2(20) PATH 'auditServiceId'
) x;
36   37  passing s.messagetext
ERROR at line 33:
ORA-00932: inconsistent datatypes: expected - got CLOB
with src as ( select xmltype(to_clob('<msgContext>
<JMSHeaders xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">
<jms1:JMSDeliveryMode>PERSISTENT</jms1:JMSDeliveryMode>
<jms1:JMSTimestamp>1329217943352</jms1:JMSTimestamp>
<jms1:JMSExpiration>0</jms1:JMSExpiration>
<jms1:JMSRedelivered>false</jms1:JMSRedelivered>
<jms1:JMSPriority>4</jms1:JMSPriority>
</JMSHeaders>
<OtherProperties>
<auditPartnerId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">010000000001189CC2BC2C</auditPartnerId>
<auditServiceId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">Auth</auditServiceId>
<correlationTransactionId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">d0022064-1df3-43ef-be5b-93aedc96b3b2</correlationTransactionId>
<auditReceivedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.346 +0100</auditReceivedDate>
<auditStatus xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">ok</auditStatus>
<auditForwardedDate xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">2012-02-14 12:12:23.351 +0100</auditForwardedDate>
<auditMsisdn xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms"/>
<auditEngineId xmlns:jms1="http://www.tibco.com/namespaces/tnt/plugins/jms">dpNorthLog</auditEngineId>
<ns0:auditInfo xmlns:ns0="http://www.tibco.com/schemas/Project_gig_reporting/tib_bw_reporting/Resources/Schemas/auditInfo.xsd">
<ns0:dp-logpoint>response</ns0:dp-logpoint>
<ns0:dp-target-url/>
<ns0:dp-port>20565</ns0:dp-port>
<ns0:dp-uri>/comp_am</ns0:dp-uri>
<ns0:dp-size>1365</ns0:dp-size>
<ns0:dp-replytoengine/>
</ns0:auditInfo>
</OtherProperties>
</msgContext>')) as messagetext from dual )
SELECT x.auditPartnerId,
x.auditServiceId
FROM src s
, XMLTable(
'/msgContext/OtherProperties'
passing s.messagetext
columns
auditPartnerId VARCHAR2(20) PATH 'auditPartnerId'
, AUDITSERVICEID VARCHAR2(20) PATH 'auditServiceId'
37  ) x;
AUDITPARTNERID          AUDITSERVICEID
010000000001189CC2BC Auth

Similar Messages

  • XML in clob columns and OWB

    I’m building some ETL process to extract data from XML in CLOB columns. I know that there are solutions to use functions as extractvalue() of WB_XML_LOAD(), but I want to know if there is any other way to deal with XML. The reason for that is because my XML files have multiple namespaces and nodes, and I need something more complex to deal with that, since I already tried those two first solutions.
    My first solution was to create a PL/SQL that parses the XML and looks for tags and elements. It populates a relational table, and I might use OWB to extract the data from this table. But I’m dealing with a large table and it takes a while for processing, plus my code is hude!
    My question is: Does someone have any experience with complex XML in Clob columns? If so, what was your solution for that?
    Thanks a lot!
    Angelo Buss
    [email protected]

    CLOB is a fully-updateable, character large object that is stored inside the database. It can be text-indexed using interMedia for document searching.
    BFILE is a readonly pointer to a file on the external file system whose content is not physically stored in the database. It can also be text-indexed for document searching, but it can't be updated.

  • Getting an error while selecting from table having CLOB column.

    Hi All,
    I have below table created in My oracle database version Oracle Database 11g Enterprise Edition Release 11.2.0.1.0.
    CREATE TABLE my_clob -- Dummy table created
    (DataBody CLOB);
    Current Database Character set - WE8MSWIN1250.
    On the front end of my application, I have one form through which I can save/edit data in the above table. If I'm creating one new entry in the above table then it first check with existing record to avoid the duplicate entry and the this point application create the below select statement on the above table and return the error "ORA-00932: inconsistent data types: expected - got CLOB".
    I can not change the sql statement.
    SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    Even when I run the same statement on my DB server I’m getting the same error. Shown below
    SQL> SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    SELECT * FROM my_clob WHERE databody IS NULL OR databody =''
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    SQL>
    Is there anything with OraOLEDB which causing this error? Please help me out to get rid of this error.
    Thanks,
    Santosh

    You cannot compare directly a CLOB column with a VARCHAR2 column. In your case you don't need to do such comparison because Oracle consider zero length strings as null values:
    SQL> create table my_clob(data int, databody clob);
    Table created.
    SQL> insert into my_clob values(1, null);
    1 row created.
    SQL> insert into my_clob values(2, '');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from my_clob where databody is null;
          DATA
    DATABODY
             1
             2About null values in Oracle, please read http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements005.htm#SQLRF30037.

  • From XML in CLOB to relational table doubt

    versions 11.2.0.2.0 / 10.2.0.4.0
    It's a long time, no see since my last dealing with xml and no luck to have an attribute value returned into the relational table.
    It's *<IntrBkSttlmAmt Ccy="???">999999</IntrBkSttlmAmt>*
    For the rest the below works in both versions but used on an xml having a 10000 <CdtTrfTxInf> on 11g it took 9 seconds and was killed because no answer was produced after 30 minutes on 10g. A colleague using java loaded the relational table in 34 seconds on 10g and produced the relational table on 11g in just 5 seconds.
    The 10g version is surviving with no xmldb installed and there are rumors our thinking heads didn't succeed to deactivate it on 11g yet.
    Any suggestion concerning alternate ways to produce a relational table from an xmltype located in a clob column of a relational table are welcome
    (looking at CLOB in XML to Normal table Best approach? I thought too many xmltable would have to be used)
    with
    the_data as
    (select q'~
                <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01">
                   <pacs.008.001.01>
                      <GrpHdr>
                         <MsgId>1L1U000JB4UT1FVS</MsgId>
                         <MsgId>9X9X999XX9XX9XXX</MsgId>
                         <CreDtTm>YYYY-MM-DDTHH:MI:SS</CreDtTm>
                         <NbOfTxs>99999</NbOfTxs>
                         <TtlIntrBkSttlmAmt Ccy="???">9999999</TtlIntrBkSttlmAmt>
                         <IntrBkSttlmDt>YYYY-MM-DD</IntrBkSttlmDt>
                            <SttlmInf>
                               <SttlmMtd>XXXX</SttlmMtd>
                                  <ClrSys>
                                      <ClrSysId>XXXX</ClrSysId>
                                  </ClrSys>
                               </SttlmInf>
                      </GrpHdr>
                      <CdtTrfTxInf>
                         <PmtId>
                            <InstrId>XXXXXXX999999-XX999999.XX</InstrId>
                            <EndToEndId>X9999999999</EndToEndId>
                            <TxId>X9999-9999999999</TxId>
                         </PmtId>
                         <PmtTpInf>
                            <SvcLvl>
                               <Cd>XXXX</Cd>
                            </SvcLvl>
                        </PmtTpInf>
                        <IntrBkSttlmAmt Ccy="???">999999</IntrBkSttlmAmt>
                        <ChrgBr>XXXX</ChrgBr>
                        <InstgAgt>
                           <FinInstnId>
                              <BIC>XXXXXX9X</BIC>
                           </FinInstnId>
                        </InstgAgt>
                        <Dbtr>
                           <Nm>NAME</Nm>
                           <PstlAdr>
                              <AdrLine>ADDRESS</AdrLine>
                              <AdrLine>CITY</AdrLine>
                              <Ctry>XX</Ctry>
                           </PstlAdr>
                        </Dbtr>
                        <DbtrAcct>
                           <Id>
                              <IBAN>XX99999999999999999</IBAN>
                           </Id>
                        </DbtrAcct>
                        <DbtrAgt>
                           <FinInstnId>
                              <BIC>XXXXXX9X</BIC>
                           </FinInstnId>
                        </DbtrAgt>
                        <CdtrAgt>
                           <FinInstnId>
                              <BIC>XXXXXX9X</BIC>
                           </FinInstnId>
                        </CdtrAgt>
                        <Cdtr>
                           <Nm>NAME</Nm>
                           <PstlAdr>
                              <AdrLine>ADDRESS</AdrLine>
                              <AdrLine>CITY</AdrLine>
                              <Ctry>XX</Ctry>
                           </PstlAdr>
                        </Cdtr>
                        <CdtrAcct>
                           <Id>
                              <IBAN>XX99999999999999999</IBAN>
                           </Id>
                        </CdtrAcct>
                        <RmtInf>
                           <Strd>
                              <CdtrRefInf>
                                 <CdtrRef>X99999999-9999999999</CdtrRef>
                              </CdtrRefInf>
                              <AddtlRmtInf>ADDITIONAL INFO</AddtlRmtInf>
                           </Strd>
                        </RmtInf>
                      </CdtTrfTxInf>
                   </pacs.008.001.01>
                </Document>
              ~' the_column
       from dual
    select v.instrid,v.endtoendid,v.txid,v.cd,
           v.ccy,  /* returned as NULL - the only attribute value */
           v.intrbksttlmamt,v.chrgbr,v.bic1,v.nm1,v.adrline11,v.adrline12,v.ctry1,v.iban1,
           v.bic2,v.bic3,v.nm2,v.adrline21,v.adrline22,v.ctry2,v.iban2,v.cdtrref,v.addtlrmtinf
      from (select xmltype(the_column) the_column_xml
              from the_data
           ) w,
           xmltable(xmlnamespaces(default 'urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01'),
                    'for $r in /Document/pacs.008.001.01/CdtTrfTxInf
                     return <rw>
                              <InstrId>{$r/PmtId/InstrId}</InstrId>
                              <EndToEndId>{$r/PmtId/EndToEndId}</EndToEndId>
                              <TxId>{$r/PmtId/TxId}</TxId>
                              <Cd>{$r/PmtTpInf/SvcLvl/Cd}</Cd>
                              <Ccy>{$r/IntrBkSttlmAmt/@Ccy}</Ccy>
                              <IntrBkSttlmAmt>{ora:replace($r/IntrBkSttlmAmt,"[.]",",")}</IntrBkSttlmAmt>
                              <ChrgBr>{$r/ChrgBr}</ChrgBr>
                              <BIC1>{$r/InstgAgt/FinInstnId}</BIC1>
                              <Nm1>{$r/Dbtr/Nm}</Nm1>
                              <AdrLine11>{$r/Dbtr/PstlAdr/AdrLine[1]}</AdrLine11>
                              <AdrLine12>{$r/Dbtr/PstlAdr/AdrLine[2]}</AdrLine12>
                              <Ctry1>{$r/Dbtr/PstlAdr/Ctry}</Ctry1>
                              <IBAN1>{$r/DbtrAcct/Id}</IBAN1>
                              <BIC2>{$r/DbtrAgt/FinInstnId}</BIC2>
                              <BIC3>{$r/CdtrAgt/FinInstnId}</BIC3>
                              <Nm2>{$r/Cdtr/Nm}</Nm2>
                              <AdrLine21>{$r/Cdtr/PstlAdr/AdrLine[1]}</AdrLine21>
                              <AdrLine22>{$r/Cdtr/PstlAdr/AdrLine[2]}</AdrLine22>
                              <Ctry2>{$r/Cdtr/PstlAdr/Ctry}</Ctry2>
                              <IBAN2>{$r/CdtrAcct/Id}</IBAN2>
                              <CdtrRef>{$r/RmtInf/Strd/CdtrRefInf/CdtrRef}</CdtrRef>
                              <AddtlRmtInf>{$r/RmtInf/Strd/AddtlRmtInf}</AddtlRmtInf>
                            </rw>'
                     passing w.the_column_xml
                     columns instrid         varchar2(300)   path '/rw/InstrId',
                             endtoendid      varchar2(150)   path '/rw/EndToEndId',
                             txid            varchar2(200)   path '/rw/TxId',
                             cd              varchar2(50)    path '/rw/Cd',
                             ccy             varchar2(50)    path '/rw/Ccy',
                             intrbksttlmamt  varchar2(50)    path '/rw/IntrBkSttlmAmt',
                             chrgbr          varchar2(100)   path '/rw/ChrgBr',
                             bic1            varchar2(100)   path '/rw/BIC1',
                             nm1             varchar2(1000)  path '/rw/Nm1',
                             adrline11       varchar2(1000)  path '/rw/AdrLine11',
                             adrline12       varchar2(1000)  path '/rw/AdrLine12',
                             ctry1           varchar2(50)    path '/rw/Ctry1',
                             iban1           varchar2(200)   path '/rw/IBAN1',
                             bic2            varchar2(100)   path '/rw/BIC2',
                             bic3            varchar2(100)   path '/rw/BIC3',
                             nm2             varchar2(1000)  path '/rw/Nm2',
                             adrline21       varchar2(1000)  path '/rw/AdrLine21',
                             adrline22       varchar2(1000)  path '/rw/AdrLine22',
                             ctry2           varchar2(50)    path '/rw/Ctry2',
                             iban2           varchar2(200)   path '/rw/IBAN2',
                             cdtrref         varchar2(1000)  path '/rw/CdtrRef',
                             addtlrmtinf     varchar2(1000)  path '/rw/AddtlRmtInf'
                   ) vRegards
    Etbin

    Hi,
    It's a long time, no see since my last dealing with xml and no luck to have an attribute value returned into the relational table.When you use this :
    <Ccy>{$r/IntrBkSttlmAmt/@Ccy}</Ccy>That doesn't set the value of the Ccy element with the attribute value, but actually add the attribute Ccy to the element Ccy, which results in
    <Ccy Ccy="???"></Ccy>Knowing that, you have three options :
    1) Leaving the XQuery as it is and using this instead in the COLUMNS clause :
                             ccy             varchar2(50)    path '/rw/Ccy/@Ccy',2) Modifying the XQuery to get the atomic value out of the attribute (using the fn:data function) :
                              <Ccy>{fn:data($r/IntrBkSttlmAmt/@Ccy)}</Ccy>3) Simplifying the whole thing, something like :
    select v.instrid, v.endtoendid, v.txid, v.cd, v.ccy,
           replace(v.intrbksttlmamt,'.',',') as intrbksttlmamt, v.chrgbr, v.bic1, v.nm1, v.adrline11, v.adrline12, v.ctry1, v.iban1,
           v.bic2, v.bic3, v.nm2, v.adrline21, v.adrline22, v.ctry2, v.iban2, v.cdtrref, v.addtlrmtinf
      from the_data w,
           xmltable(xmlnamespaces(default 'urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01'),
                    '/Document/pacs.008.001.01/CdtTrfTxInf'
                     passing xmltype(w.the_column)
                     columns instrid         varchar2(300)   path 'PmtId/InstrId',
                             endtoendid      varchar2(150)   path 'PmtId/EndToEndId',
                             txid            varchar2(200)   path 'PmtId/TxId',
                             cd              varchar2(50)    path 'PmtTpInf/SvcLvl/Cd',
                             ccy             varchar2(50)    path 'IntrBkSttlmAmt/@Ccy',
                             intrbksttlmamt  varchar2(50)    path 'IntrBkSttlmAmt',
                             chrgbr          varchar2(100)   path 'ChrgBr',
                             bic1            varchar2(100)   path 'InstgAgt/FinInstnId',
                             nm1             varchar2(1000)  path 'Dbtr/Nm',
                             adrline11       varchar2(1000)  path 'Dbtr/PstlAdr/AdrLine[1]',
                             adrline12       varchar2(1000)  path 'Dbtr/PstlAdr/AdrLine[2]',
                             ctry1           varchar2(50)    path 'Dbtr/PstlAdr/Ctry',
                             iban1           varchar2(200)   path 'DbtrAcct/Id',
                             bic2            varchar2(100)   path 'DbtrAgt/FinInstnId',
                             bic3            varchar2(100)   path 'CdtrAgt/FinInstnId',
                             nm2             varchar2(1000)  path 'Cdtr/Nm',
                             adrline21       varchar2(1000)  path 'Cdtr/PstlAdr/AdrLine[1]',
                             adrline22       varchar2(1000)  path 'Cdtr/PstlAdr/AdrLine[2]',
                             ctry2           varchar2(50)    path 'Cdtr/PstlAdr/Ctry',
                             iban2           varchar2(200)   path 'CdtrAcct/Id',
                             cdtrref         varchar2(1000)  path 'RmtInf/Strd/CdtrRefInf/CdtrRef',
                             addtlrmtinf     varchar2(1000)  path 'RmtInf/Strd/AddtlRmtInf'
                   ) vThat last option could possibly get you some performance improvement as well.
    Edited by: odie_63 on 14 sept. 2011 20:57

  • XML Import CLOB column size limit

    I have a table with a CLOB column and some of the rows have up to 7000 characters in the column. I exported the table to XML and the XML file contains all the data. When I try to import the file into another APEX instance I get the error:
    XML Load error.
    After some experimentation, I found that If I manually edit the XML to reduce the size of the text to under 4000 characters (3700 in my test), it imports fine.
    Is there a way around this limitation? The database I'm migrating has LOTS of CLOB columns (converted from MS Access "memo" fields).

    jlange,
    Having converted a bunch of MS Access applications myself, I would encourage you to look at the Oracle Migration Workbench (OMWB): http://www.oracle.com/technology/tech/migration/index.html
    This free tool can be downloaded from OTN, and provides a more streamlined approach to moving the data from MS Access to Oracle, including support for Memos to CLOBs.
    Once you're data has been moved over, you can then use ApEx to re-create the UI.
    Thanks,
    - Scott -

  • Checked or Filled field from XML

    Hi!
    I have question with start form from XML.
    How to run a form from the xml so that when you turn they were running some of the elements: RadioButton or EditText item filled with value?
    For Example:
    I have a text field and I would like to set the form field that was filled with the value "aaa"
    I have a checkbox field and would like to set the form was checked.
    I do not want to use coding for this purpose. Is there any solution to this problem?
    regards,
    Krzysztof

    Link this dropdown to the xml tag with the proper values. So that Option A has the associated cost as the value for this option and so on. In the exit event of the dropdown set the text box value with the selected value from Dropdown.
    TextBox1.rawValue = DropDown1.rawValue;
    Thanks
    Srini

  • Export data from table with CLOB column

    DB: Oracle10g
    SQLDeveloper: 1.0
    OS: windows xp for sqldeveloper
    Linux for Oracle db
    we have a table with two CLOB columns. We want to export the data to either text or csv. But the CLOB columns don't show up in the columns that can be exported.
    How do I export CLOB data from SQL Developer?
    Regards,
    Lonneke

    I don't think this is a good protection: you can have these characters in VARCHAR anyway, and this way you "throw the baby out with the bath water". Not mentioning that right now also immune formats like HTML are also limited.

  • Select data from xml content

    Hi,
    I have xmlcontent stored in a table as CLOB content with this format:
    <?xml version="1.0" encoding="utf-8" ?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
    <ns1:searchByCommonNameGroupIdAndCim10IdsResponse xmlns:ns1="urn:Vidal">
    <ns1:contraIndicationCim10List>
    <contraIndications xmlns="urn:Vidal">
    <contraIndicationTypeCim10Tuple>
    <cim10>
    <code>J11</code>
    <id>3333</id>
    <name />
    </cim10>
    <contraIndication>
    <id>1111</id>
    <name>some data written here</name>
    </contraIndication>
    <type>A</type>
    </contraIndicationTypeCim10Tuple>
    <contraIndicationTypeCim10Tuple>
    <cim10>
    <code>J11</code>
    <id>3333</id>
    <name />
    </cim10>
    <contraIndication>
    <id>2222</id>
    <name>some data written here</name>
    </contraIndication>
    <type>A</type>
    </contraIndicationTypeCim10Tuple>
    </contraIndications>
    <homogeneous xmlns="urn:Vidal">true</homogeneous>
    </ns1:contraIndicationCim10List>
    </ns1:searchByCommonNameGroupIdAndCim10IdsResponse>
    </soap:Body>
    </soap:Envelope>
    and I want to view th data as report (I need tha date id, code, name to view it in the report.)
    I wrote the following query:
    select EXTRACTVALUE(xmltype.createxml(clob001),'/soap:Envelope/soap:Body/ns1:searchByCommonNameGroupIdAndCim10IdsResponse/ns1:contraIndicationCim10List/contraIndications/contraIndicationTypeCim10Tuple/contraIndication/code','xmlns:ns1="urn:Vidal"') code
    from wwv_flow_collections c
    where c.collection_name = 'MY_COLLECION_NAME'
    but I got the following error:
    report error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/soap:Envelope/soap:Body/ns1:searchByCommonNameGroupIdAndCim10IdsResponse/ns1:contraIndicationCim10List/contraIndications/contraIndicationTypeCim10Tuple/contraIndication/code'
    any idea about this please.
    Regards.
    Mohd.

    Hi,
    It is solved, I wrote as :
    select extractValue(value(t),'/*/contraIndication/id','xmlns="urn:Vidal"') "id"
    from wwv_flow_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'//contraIndicationTypeCim10Tuple','xmlns="urn:Vidal"'))) t
    where c.collection_name = 'MY_COLLECTION_NAME' ;
    and it is working fine.
    Regards.
    Mohd.

  • To fetch selective fields from DATABASETABLE into Internal TABLE

    Hi Friends,
    I have declared an internal table with fields for e.g. A , B , C , D.
    This does not have any records as of now.
    I have to fetch data from a DATABASE TABLE with fields A , B , X , Y , Z having records .
    I only need records for fields A B fron DB table.Can any one pls tell how can I do that with performance issues in mind as lots of records are there.
    I had written a query where:
    SELECT A B from dbtab
                        into CORRESPONDING FIELDS of table it_table.
    It_table i had defined with only two fields A B.
    Is this correct?
    Please tell wats the way to do it as I am new to ABAP.
    THANKS in ADVANCE..

    Hi.....
    What mentioned in all above answers is very helpful for ur requirement...
    and...
       Here some Steps to increase the performence of your programs...
    >Use Select Single when only one row is expected
    >Use Select Where rather than Selectu2026Check
    >Use Select with aggregate functions (SUM, MAX, MINu2026)
    >Use a View instead of nested Selects
    >Use Select column specific instead of select * for few fields
    >Use Selectu2026Into Table rather than Select...Move Corru2026Apend
    >Use Join extension with Select if possible
    >Use special operators (CO, CA, CS) rather than code your own
    >Use Delete Adjacent Duplicates rather than manual processing
    >Specify key fields for Readu2026Binary Search
    >Use Loop At Where rather than Loop Atu2026Check
    >Copy Internal Tables with TAB_DEST() = TAB_SRC()
    >Specify the sort key as restrictively as possible
    >Use Append To, Insert Into, Collect Into rather than Move
    >Compare tables with If Tab1() = Tab2()u2026
    >Use Delete ITAB Whereu2026 instead of Loop At ITAB Whereu2026Delete..
    >Use Case statements instead of If-constructions
    >Use Call Functions wisely, Performs use less memory
    >Use While instead of Do Exit
    >Use Type I for Indices
    >Keep Occurs clause realistic or use 0
    >Use COMMIT WORK as appropriate to free the Data Base and preserve work
    >
    >Avoid:
    >Using Shift inside a While-loop
    >Leaving unneeded declarations in your program
    >Using Move-corresponding for just a few fields
    >Excessive nested includes within function calls
    >Using DB field names if the value will be changed
    >Using Occurs clause if only the header is needed
    Thanks,
    Naveen.I

  • Web service Response data - how to extract fields from XMl returned

    Hi,
        I am using a web service in adobe forms to get currency , by entering country name. I generated the fields i form by clicking on 'Generate fields ' it automatically generated the biding.
    The problem is that in response field , i get the whole XML , wheras i just need the currecny value.
    Below is the o/p.
    <NewDataSet>
      <Table>
        <Name>India</Name>
        <CountryCode>in</CountryCode>
        <Currency>Rupee</Currency>
        <CurrencyCode>INR</CurrencyCode>
      </Table>
      <Table>
        <Name>India</Name>
        <CountryCode>in</CountryCode>
        <Currency>Rupee</Currency>
        <CurrencyCode>INR</CurrencyCode>
      </Table>
    </NewDataSet>
    I just want INR to be shown in the text field?
    Plz help..

    You might have to tweak this code some to get it to work, but it should at least lay the groundwork for solving your problem:
    Code Snippet
    /* Declare an XmlNode object and initialize it with the XML response from the GetListItems method. The last parameter specifies the GUID of the Web site containing the list. Setting it to null causes the Web site specified by the Url property to be used.*/
                System.Xml.XmlNode nodeListItems =
                    MyListsService.GetListItems
                    (listName, viewName, query, viewFields, rowLimit, queryOptions, null);
    System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
    xd.LoadXml(nodeListItems.OuterXml);
    System.Xml.XmlNamespaceManager nm = new System.Xml.XmlNamespaceManager(xd.NameTable);
    nm.AddNamespace("rs", "urn:schemas-microsoft-com:rowset");
    nm.AddNamespace("z", "#RowsetSchema");
    nm.AddNamespace("rootNS", "http://schemas.microsoft.com/sharepoint/soap");
    System.Xml.XmlNodeList nl = xd.SelectNodes("/rootNS:listitems/rs:data/z:row", nm);
    foreach(System.Xml.XmlNode listItem in nl)
      listBoxProsjekter.Items.Add(listItem.OuterXml);
    I hope this helps!
    Please look into the following site for more info:
    http://msdn2.microsoft.com/en-us/library/4bektfx9(vs.80).aspx

  • How to parse and retrieve records from xml files into columns in Table

    Hi
    I attached the thing what i tried.
    Table to hold the XML COntent:
    create table xmlfile(xml_con sys.xmltype);
    Inserting Xml file content into the Above table:
    insert into xmlfile values(sys.xmltype.CreateXml('<Root><name>RAM</name><age>23</age></Root>'))
    SQL> select * from xmlfile;
    XML_CON
    <Root>
    <name>RAM</name>
    <age>23</age>
    </Root>
    SQL> select extractValue(xml_con, '/Root/name') content from xmlfile;
    CONTENT
    RAM
    This one works fine
    But if the file content is as below( contains MUltiple Records)
    insert into xmlfile values(sys.xmltype.CreateXml('<Root><Record><name>RAM</name><age>23</age></Record><Record><name>SAM</name><age>23</age></Record></Root>'))
    SQL> select extractValue(xml_con, '/Root/Record/name') content from xmlfile;
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one node
    Can anyone help me 4 this issue-How to extract multiple records from the XML file inthis manner(from PL/SQL without using JAVA)
    OR
    If there is anyother way to do this please tell me?

    SQL> SELECT EXTRACTVALUE (COLUMN_VALUE, '//name') NAME,
           EXTRACTVALUE (COLUMN_VALUE, '//age') age
      FROM TABLE
              (XMLSEQUENCE
                  (EXTRACT
                      (XMLTYPE
                          ('<Root>
                              <Record>
                                <name>RAM</name>
                                <age>23</age>
                              </Record>
                              <Record>
                                <name>SAM</name>
                                <age>23</age>
                              </Record>
                            </Root>'
                       '/Root/Record'
    NAME       AGE      
    RAM        23       
    SAM        23       
    2 rows selected.

  • Select fields from Table PA0001 where condition in PA0000 EQ X.

    I'm quite new here at SDN an to ABAP as my code below will show.  =)
    I have two tables PA0001 and PA0000 and I want to show the PERNR from Table PA0001 WHERE PA0000-stat2 EQ '3'.
    SELECT PERNR STAT2 FROM pa0000 INTO CORRESPONDING FIELDS OF TABLE it_act WHERE stat2 EQ '3'.    "this works fine
    SELECT * FROM pa0001 INTO TABLE it_pos.
    LOOP AT it_pos INTO wa_pos WHERE It_pos-pernr EQ it_act-pernr.                
    WRITE......
    ENDLOOP.
    Isn't it possible to put the conditions in the LOOP statement? Should i somehow do i join in the select instead?
    If you dont understand what I mean just ask and I will try to explain.
    Best Regards Claes.

    Hi Claes Widestadh ,
    I have total Code for you, to solve your Problem, I have written the code for you & tested it, and it was Working Very Fine.
    Please find the Below Code.
    TABLES : PA0000, PA0001.
    DATA : IT_PA0000 LIKE PA0000 OCCURS 0 WITH HEADER LINE,
           IT_PA0001 LIKE PA0001 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           END OF IT_FINAL.
    SELECT PERNR STAT2 INTO CORRESPONDING FIELDS OF TABLE IT_PA0000 FROM
    PA0000 WHERE STAT2 = '3'.
    SELECT * FROM PA0001 INTO TABLE IT_PA0001.
    SORT IT_PA0001.
    LOOP AT IT_PA0000.
      READ TABLE IT_PA0001 WITH KEY PERNR = IT_PA0000-PERNR.
      IF SY-SUBRC = 0.
        IT_FINAL-PERNR = IT_PA0001-PERNR.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
      ENDIF.
    ENDLOOP.
    LOOP AT IT_FINAL.
      WRITE :/ IT_FINAL.
    ENDLOOP.
    Note: If you find this Answer is very Helpful Please allot me the Points.
    Please do let me know any isssues at your end.
    Thanks,
    Satya Krishna.M

  • Load XML to CLOB column

    i want to load xml file to a column with CLOB datatype.
    I can do it with the help of tools like TOAD etc but i want to do through sql or pl/sql.
    Can anybody can help on this?

    Check this.
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html#PLSQLCode
    Regards
    Sundar

  • Populating Text Fields from XML Based Drop Down

    Hello,
    I'm new to the Adobe Livecycle I have been challenged to make a PDF form that pulls information from an XML file.
    I have been able to get the from to read the XML file and I have successfully created a dynamic pull down, but what I am having a problem with is that when an item is selected in the dropdown I want it to pull other information stored in the XML file.
    <user>
      <csrName>MyName</csrName>
      <csrExt>123</csrExt>
      <csrFax>123-123-1234</csrFax>
    </user>
    <user>
      <csrName>MyName</csrName>
      <csrExt>321</csrExt>
      <csrFax>999-234-1322</csrFax>
    </user>
    My pulldown reads each csrName and I can select whom I want, but how do I get <csrExt> and <csrFax> to pull over for the correct <csrName>? I figured it needs to be done by some code during the "Change Event" but I have not figured out what code is needed.
    Any help is greatly appreciated, if anymore information is needed just let me know and I'll share what I got.
    Thanks
    Derrick

    Thanks for the reply.
    Right now I'm starting with a blank form and once I get my head wrapped around this then I was going to modify what is already in use.
    I'm attaching my scheme and xml file.
    Thanks!
    Derrick
    I get an error when trying to upload my schema. I am pasting the content of the file here. I call it proofout.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="userList" type="UserList" />
    <xs:complexType name="User">
      <xs:sequence>
       <xs:element name="csrName" type="xs:string" />
       <xs:element name="csrExt" type="xs:int" />
       <xs:element name="csrFax" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="UserList">
       <xs:sequence maxOccurs="unbounded">
        <xs:element name="user" type="User" />
        </xs:sequence>
        </xs:complexType>
        </xs:schema>

  • Select fields from two tables

    Query works fine when I query one table. When I add the
    second it generates the following error.
    -1:[Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Could not find
    file 'C:\CFusionMX7\db\slserver54\logging\mob.mdb'
    See code.
    Thank you

    Also does Access understand this way of joining tables? I do
    not
    believe I have very seen Access SQL that did not use INNER
    JOIN syntax.
    I.E.
    FROM mob_user JOIN mob_user_type ON mob_user.user_type_id =
    mob_user_type.user_type_id

Maybe you are looking for

  • Why is my iMac running extremely slowly??

    My mid-2010 iMac has been running excrutiatingly slowly over the past few months, with the spinning beachball popping up any time I click on anything at all. I started in SafeMode and the problem disappears, leading me to believe it might be a softwa

  • Using waveform chart to collect data

    Hello, I am a new user to labview, however I have been using it for a while now. I have a simple problem. My model runs a drive cycle for 1400 secs. I want to record data for a sample rate of 1 sec. However, When I try to run the model and export it

  • Can't import JPGs but I can open with Preview

    iPhoto 4, OSX 10.3.9 I copied hundreds of JPGs (from XP) to OSX and tried to import them into iPhoto. I get an error message. "Unreadable Files The following files could not be imported (they may be an unrecognized file type of the files may not cont

  • HOW DO YOU CHANGE THE WINDOW SIZE OF EBUSINESS SUITE ON STARTUP

    HOW DO YOU CHANGE THE WINDOW SIZE OF EBUSINESS SUITE ON STARTUP How do you change the window size for Ebusiness Suite after you log in. Currently it displays at 100% of the screen. I want to set it smaller, at some %

  • Can't Print after Software Update

    After completing an Apple software update which included Epson printer software update 2.7 I am unable to print. I get an error message; Error:/Library/Printers/EPSON/InkjetPrinter2Filter/rastertoescpll.app/Contents/ MacOS/rasertoescpll failed. Can y