Extract a repeated item

Hello!

I use Oracle 10 g 2.

How can I retrieve the value of the IUM tag? Is this correct syntax (a repeated element of many times without a group above it)?

When it is an attribute of the cxMed tag, I can do what I need (code below).
  WITH tmp AS
  (SELECT XMLTYPE('<root>
                    <inf>
                      <det nItem="1">
                        <prod>
                          <med>
                            <nLote>lote 0</nLote>
                            <qLote>0</qLote>
                            <dFab>2011-03-01</dFab>
                            <dVal>2012-03-01</dVal>
                            <vPMC>300</vPMC>
                          </med>
                          <med>
                            <nLote>lote 1</nLote>
                            <qLote>1</qLote>
                            <dFab>2011-01-01</dFab>
                            <dVal>2012-01-01</dVal>
                            <vPMC>100</vPMC>
                            <IUM>1</IUM>
                            <IUM>2</IUM>
                            <IUM>3</IUM>
                            <IUM>4</IUM>
                            <IUM>5</IUM>
                          </med>
                          <med>
                            <nLote>lote 2</nLote>
                            <qLote>2</qLote>
                            <dFab>2011-02-02</dFab>
                            <dVal>2012-02-02</dVal>
                            <vPMC>200</vPMC>
                            <cxMed IUM="1">
                              <IUC>21</IUC>
                            </cxMed>
                            <cxMed IUM="2">
                              <IUC>22</IUC>
                            </cxMed>
                            <cxMed IUM="3">
                              <IUC>23</IUC>
                            </cxMed>
                          </med>
                          <med>
                            <nLote>lote 4</nLote>
                            <qLote>4</qLote>
                            <dFab>2011-04-01</dFab>
                            <dVal>2012-04-01</dVal>
                            <vPMC>300</vPMC>
                          </med>
                        </prod>
                      </det>
                      <det nItem="2">
                        <prod>
                          <med>
                            <nLote>lote 1</nLote>
                            <qLote>1</qLote>
                            <dFab>2011-01-01</dFab>
                            <dVal>2012-01-01</dVal>
                            <vPMC>100</vPMC>
                            <IUM>1</IUM>
                            <IUM>2</IUM>
                            <IUM>3</IUM>
                            <IUM>4</IUM>
                            <IUM>5</IUM>
                          </med>
                        </prod>
                      </det>
                    </inf>
                  </root>') as XMLArquivo from dual
  )
          SELECT --/NFe/infNFe/det
                 vw.nItem,
                 --/NFe/infNFe/det/prod/med
                 vw2.IdMedicamento,
                 vw3.IdIUM,
                 vw3.IUM,
                 vw3.IUC
            FROM tmp,
            XMLTABLE('/root/inf/det'
                     PASSING tmp.XMLArquivo
                     COLUMNS
                       nItem  NUMBER(3) PATH '@nItem', 
                       medXML XMLTYPE   PATH 'prod/med') vw,
            XMLTABLE('/med'
                     PASSING vw.medXML
                     COLUMNS
                       IdMedicamento FOR ORDINALITY,
                       cxMedXML XMLTYPE PATH 'cxMed') vw2,
            XMLTABLE('/cxMed'
                     PASSING vw2.cxMedXML
                     COLUMNS
                       IdIUM FOR ORDINALITY,
                       IUM NUMBER(13) PATH '@IUM',
                       IUC NUMBER(18) PATH 'IUC') vw3
Thank you
Luciana

Published by: Luciana on 21 January 2011 08:33

Published by: Luciana on 21 January 2011 08:34

Published by: Luciana on 21 January 2011 09:47

Hi Luciana,

Something like that?

WITH tmp AS
  (SELECT XMLTYPE('
                    
                      
                        
                          
                            lote 0
                            0
                            2011-03-01
                            2012-03-01
                            300
                          wcv
                          
                            lote 1
                            1
                            2011-01-01
                            2012-01-01
                            100
                            1
                            2
                            3
                            4
                            5
                          
                          
                            lote 2
                            2
                            2011-02-02
                            2012-02-02
                            200
                            
                              21
                            
                            
                              22
                            
                            
                              23
                            
                          
                          
                            lote 4
                            4
                            2011-04-01
                            2012-04-01
                            300
                          
                        
                      
                      
                        
                          
                            lote 1
                            1
                            2011-01-01
                            2012-01-01
                            100
                            1
                            2
                            3
                            4
                            5
                          
                        
                      
                    
                  ') as XMLArquivo from dual
  )
          SELECT --/NFe/infNFe/det
                 vw.nItem,
                 --/NFe/infNFe/det/prod/med
                 vw2.IdMedicamento,
                 vw3.IdIUM,
                 vw3.IUM,
                 vw3.IUC,
                 vw4.IUM
            FROM tmp,
            XMLTABLE('/root/inf/det'
                     PASSING tmp.XMLArquivo
                     COLUMNS
                       nItem  NUMBER(3) PATH '@nItem',
                       medXML XMLTYPE   PATH 'prod/med') vw,
            XMLTABLE('/med'
                     PASSING vw.medXML
                     COLUMNS
                       IdMedicamento FOR ORDINALITY,
                       cxMedXML XMLTYPE PATH 'cxMed',
                       IUMXML   XMLTYPE PATH 'IUM') vw2,
            XMLTABLE('/cxMed'
                     PASSING vw2.cxMedXML
                     COLUMNS
                       IdIUM FOR ORDINALITY,
                       IUM NUMBER(13) PATH '@IUM',
                       IUC NUMBER(18) PATH 'IUC') (+) vw3,
            XMLTABLE('/IUM'
                     PASSING vw2.IUMXML
                     COLUMNS
                       IUM NUMBER(13) PATH '.') (+) vw4
;

Must "CxMed/@IUM" and ' med/IUM' be in the same column?

Tags: Oracle Development

Similar Questions

  • Linking a sequence of XSD schema to subform repeated items

    Hi, I have created a form with the rows in the table that is repeated using an Add button to add rows dynamically. I lie the line with the schema xsd with a [*] at the end of the option of data binding with ticked repeat rows for each data item. All by submitting the form as XML data to java controller I get only one line of the table and not other lines dynamically added by add the functionality of the button.

    Untitled.jpgUntitled1.jpg

    Untitled2.png

    I want to know that how generate the XML for lines added dynamically linked with an XSD schema.

    I also explored the link below, but is not to solve the problems:

    http://www.Adobe.com/devnet/LiveCycle/articles/binding-XSD.html

    Thanks in advance

    I have solved the problems by adding maxOccurs = "unbounded" in the xsd schema with the name of the bound element.

  • What is the value of repeat items only?

    I'm trying to understand the value of repeating only objects. I was hoping to create a list with the editable elements < li > and < li > does not have a tag that is supported for the editable regions. But it is supported as a repeat region. Can someone explain to me, or provide an example of the real world, of why this might be useful to the customer? In other words, why a customer would want the opportunity to move up, down, add, or remove an item, but not be able to change the content of the element?

    Is there a workaround to create a combo box or list items?

    Thank you.

    Hello antlion.

    You can wrap the content of the

  • s in editable divs. You have created your repeating group and applied repeatedly = "true" for the list items, but only InContext Editing allows regions editable on div, th, and td elements.

    In Dreamweaver, select the content of your

  • then choose Insert > InContext Editing > create editable region. Dreamweaver invites you to 'wrap the current selection with a DIV tag and then transform '. Click OK, and then repeat this step for each item in the list. The result will create boxes for your list items, and you look at something like:

  • Repeat items in a stacked sequence

    Hi does anyone know how to repeat elements of a stacked sequence?  For example, if I want to repeat that frames 7-12, how would I go all this?  I was watching the State machines, but also to try to understand.  I thought that there could be an easier way to do somehow with a while loop, but not sure how I would go all this.  Thank you!

    Jon

    You need to understand the state machine. It serves to do just what you want to do.

  • Extract data from xml file item

    I inserted all data from an xml file into an xml table in the database (after creating the directory and getclobdocument function)
    with

    INSERT INTO TEST_XML
    SELECT (XMLTYPE (getCLOBDocument ('MXMLF.xml'))) FROM DUAL;

    Now how to extract the individual item in the relational table my data in the xml table is something like the following.

    rowset <>
    < TransmissionHeader >
    < TransmissionDateTime > 2008 - 12 - 04T 09: 30:47 - 05:00 < / TransmissionDateTime >
    IATA:ISXMLInvoiceV3.1 < version > < / Version >
    < IssuingOrganizationID > 111 < / IssuingOrganizationID >
    < BillingCategory > various < / BillingCategory >
    < / TransmissionHeader >
    < invoice >
    < InvoiceHeader >
    < InvoiceNumber > 182792000 < / InvoiceNumber >
    < invoiceDate > 2007 - 12 - 19 < / InvoiceDate >
    Bill < InvoiceType > < / InvoiceType >
    < LocationCode > EWR < / LocationCode >
    Engineering of < ChargeCategory > < / ChargeCategory >
    < SellerOrganization >
    < > 111 OrganizationID < / OrganizationID >
    < OrganizationDesignator > ZZ < / OrganizationDesignator >
    Zed airlines < Nomorganisation1 > < / Nomorganisation1 >
    < TaxRegistrationID > 111ABC111 < / TaxRegistrationID >
    < CompanyRegistrationID > ABC111ABC < / CompanyRegistrationID >
    Patrick < ContactName > < / ContactName >
    < address >
    < > 111, Zed AddressLine1 headquarters < / AddressLine1 >
    Montreal < CityName > < / Nom_ville >
    < CountryCode > CA < / CountryCode >
    Canada < CountryName > < / CountryName >
    < code postal > 110011 < / code >
    < / address >
    < / SellerOrganization >
    < BuyerOrganization >
    < > 222 OrganizationID < / OrganizationID >
    < OrganizationDesignator > GG < / OrganizationDesignator >
    < Nomorganisation1 > Globe Airlines < / Nomorganisation1 >
    < TaxRegistrationID > GB22200222 < / TaxRegistrationID >
    < CompanyRegistrationID > Go 222 222 < / CompanyRegistrationID >
    George < ContactName > < / ContactName >
    < address >
    < AddressLine1 > 222, Globe headquarters < / AddressLine1 >
    London < CityName > < / Nom_ville >
    < CountryCode > GB < / CountryCode >
    England < CountryName > < / CountryName >
    < code postal > 220022 < / code >
    < / address >
    < / BuyerOrganization >
    < ConditionsPaiement >
    < CurrencyCode > $ < / CurrencyCode >
    < SettlementMonthPeriod > 071203 < / SettlementMonthPeriod >
    < SettlementMethod > I < / SettlementMethod >
    < / ConditionsPaiement >
    < ISDetails >
    < DigitalSignatureFlag > N < / DigitalSignatureFlag >
    < / ISDetails >
    < setting >
    < AttachmentIndicatorOriginal > Y < / AttachmentIndicatorOriginal >
    < / fixing >
    < / InvoiceHeader >
    < LineItem >
    < LineItemNumber > 1 < / LineItemNumber >
    < ChargeCode > MRO repairs and review < / ChargeCode >
    < description > package for unique maintenance work. Water VAVLE drain compl. P/N 9350022 < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice SF = "1" > 300,0000 < / UnitPrice >
    < ChargeAmount > 300,00 < / ChargeAmount >
    < TotalNetAmount > 300,00 < / TotalNetAmount >
    < / LineItem >
    < LineItem >
    < LineItemNumber > 2 < / LineItemNumber >
    < ChargeCode > MRO repairs and review < / ChargeCode >
    < description > material consumption for the single interview. Water VAVLE drain compl. P/N 9350022, S/N FRTR013AW < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice SF = "1" > 900.0000 < / UnitPrice >
    < ChargeAmount > 900.00 < / ChargeAmount >
    < TotalAddOnChargeAmount > 180.00 < / TotalAddOnChargeAmount >
    < TotalNetAmount > 1080.00 < / TotalNetAmount >
    < / LineItem >
    < LineItemDetail >
    < DetailNumber > 1 < / DetailNumber >
    < LineItemNumber > 1 < / LineItemNumber >
    < description > package for unique maintenance work. Water VAVLE drain compl. P/N 9350022 < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice > 300,0000 < / UnitPrice >
    < ChargeAmount > 300,00 < / ChargeAmount >
    < TotalNetAmount > 300,00 < / TotalNetAmount >
    < AircraftDetails >
    < AircraftRegistrationNo > DAIGS < / AircraftRegistrationNo >
    < PartNo > 9350022 < / PartNo >
    < / AircraftDetails >
    < / LineItemDetail >
    < LineItemDetail >
    < DetailNumber > 1 < / DetailNumber >
    < LineItemNumber > 2 < / LineItemNumber >
    < description > material consumption diaphragm < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice > 200.0000 < / UnitPrice >
    < ChargeAmount > 200.00 < / ChargeAmount >
    < AddOnCharges >
    Handling of < AddOnChargeName > < / AddOnChargeName >
    < AddOnChargePercentage > 20.00 < / AddOnChargePercentage >
    < AddOnChargeableAmount > 200.00 < / AddOnChargeableAmount >
    < AddOnChargeAmount > 40.00 < / AddOnChargeAmount >
    < / AddOnCharges >
    < TotalNetAmount > 240.00 < / TotalNetAmount >
    < AircraftDetails >
    < AircraftRegistrationNo > DAIGS < / AircraftRegistrationNo >
    < PartNo > 9350584 < / PartNo >
    < / AircraftDetails >
    < / LineItemDetail >
    < LineItemDetail >
    < DetailNumber > 2 < / DetailNumber >
    < LineItemNumber > 2 < / LineItemNumber >
    < description > material consumption coverage < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice > 177.5000 < / UnitPrice >
    < ChargeAmount > 177,50 < / ChargeAmount >
    < AddOnCharges >
    Handling of < AddOnChargeName > < / AddOnChargeName >
    < AddOnChargePercentage > 20.00 < / AddOnChargePercentage >
    < AddOnChargeableAmount > 177,50 < / AddOnChargeableAmount >
    < AddOnChargeAmount > 35.50 < / AddOnChargeAmount >
    < / AddOnCharges >
    < TotalNetAmount > 213,00 < / TotalNetAmount >
    < AircraftDetails >
    < AircraftRegistrationNo > DAIGS < / AircraftRegistrationNo >
    < PartNo > 9350595 < / PartNo >
    < / AircraftDetails >
    < / LineItemDetail >
    < LineItemDetail >
    < DetailNumber > 3 < / DetailNumber >
    < LineItemNumber > 2 < / LineItemNumber >
    Assembly of material consumption - Base < description > < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice > 520.0000 < / UnitPrice >
    < ChargeAmount > 520.00 < / ChargeAmount >
    < AddOnCharges >
    Handling of < AddOnChargeName > < / AddOnChargeName >
    < AddOnChargePercentage > 20.00 < / AddOnChargePercentage >
    < AddOnChargeableAmount > 520.00 < / AddOnChargeableAmount >
    < AddOnChargeAmount > 104.00 < / AddOnChargeAmount >
    < / AddOnCharges >
    < TotalNetAmount > 624,00 < / TotalNetAmount >
    < AircraftDetails >
    < AircraftRegistrationNo > DAIGS < / AircraftRegistrationNo >
    < PartNo > 9350598 < / PartNo >
    < / AircraftDetails >
    < / LineItemDetail >
    < LineItemDetail >
    < DetailNumber > 4 < / DetailNumber >
    < LineItemNumber > 2 < / LineItemNumber >
    Packaging material consumption < description > < / Description >
    < EndDate > 2007 - 12 - 10 < / EndDate >
    < UOMCode quantity = "EA" > 1.0000 < / quantity >
    < UnitPrice > 0.0800 < / UnitPrice >
    < ChargeAmount > 0.08 < / ChargeAmount >
    < AddOnCharges >
    Handling of < AddOnChargeName > < / AddOnChargeName >
    < AddOnChargePercentage > 20.00 < / AddOnChargePercentage >
    < AddOnChargeableAmount > 0.08 < / AddOnChargeableAmount >
    < AddOnChargeAmount > 0.02 < / AddOnChargeAmount >
    < / AddOnCharges >
    < TotalNetAmount > 0.10 < / TotalNetAmount >
    < AircraftDetails >
    < AircraftRegistrationNo > DAIGS < / AircraftRegistrationNo >
    < PartNo > AS3209-009 < / PartNo >
    < / AircraftDetails >
    < / LineItemDetail >

    How now?

    Please a little help

    I tried to instead of but of no use

    The new element in the root is 'InvoiceTransmission', so replace 'Lines' with it.
    In addition, there is now a default namespace, you must declare it as well:

    SELECT x1.InvoiceNumber
         , x1.InvoiceDate
         , x1.InvoiceType
         , x1.LocationCode
         , x2.*
         , x3.*
    FROM test_xml t
       , XMLTable(
           XMLNamespaces(default 'http://www.IATA.com/IATAAviationInvoiceStandard')
         , '/InvoiceTransmission/Invoice'
           passing t.object_value
           columns InvoiceNumber   number       path 'InvoiceHeader/InvoiceNumber'
                 , InvoiceDate     date         path 'InvoiceHeader/InvoiceDate'
                 , InvoiceType     varchar2(30) path 'InvoiceHeader/InvoiceType'
                 , LocationCode    varchar2(3)  path 'InvoiceHeader/LocationCode'
                 , LineItems       xmltype      path 'LineItem'
                 , LineItemDetails xmltype      path 'LineItemDetail'
         ) x1
       , XMLTable(
           XMLNamespaces(default 'http://www.IATA.com/IATAAviationInvoiceStandard')
         , '/LineItem'
           passing x1.LineItems
           columns LineItemNumber         number        path 'LineItemNumber'
                 , ChargeCode             varchar2(80)  path 'ChargeCode'
                 , Description            varchar2(200) path 'Description'
                 , EndDate                date          path 'EndDate'
                 , Quantity               number(8,4)   path 'Quantity'
                 , Quantity_UOM           varchar2(3)   path 'Quantity/@UOMCode'
                 , UnitPrice              number(8,4)   path 'UnitPrice'
                 , UnitPrice_SF           varchar2(3)   path 'UnitPrice/@SF'
                 , ChargeAmount           number(6,2)   path 'ChargeAmount'
                 , TotalAddOnChargeAmount number(6,2)   path 'TotalAddOnChargeAmount'
                 , TotalNetAmount         number(6,2)   path 'TotalNetAmount'
         ) x2
       , XMLTable(
           XMLNamespaces(default 'http://www.IATA.com/IATAAviationInvoiceStandard')
         , '$d/LineItemDetail[LineItemNumber=$lin]'
           passing x1.LineItemDetails as "d"
                 , x2.LineItemNumber as "lin"
           columns AircraftRegistrationNo varchar2(30) path 'AircraftDetails/AircraftRegistrationNo'
                 , PartNo                 varchar2(30) path 'AircraftDetails/PartNo'
         ) x3
    ;
    
  • several items taken from repetition of XML document

    Oracle 11.1.0.7 Enterprise Edition version

    Solaris 10 Sparc 64-bit

    Hello all,.

    I hope you can help me because I was able to find a useful solution through research and good old fashioned trial and error!

    I have an XML document that I loaded successfully and is stored as an xmltype in a table "GetWOAFinishingPigsRe1711_TAB" (the name of the generated System) and who has nested, picking up items (below) - excuse the object! :

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

    < tns:GetWOAFinishingPigsResponse xmlns:tns ="Http://localhost: 8085/WS_WoaFinishingPigs_GetAllData" > ""

    - < WS_ResultWoaFinishingPigs >

    < ReasonsForNotCompleting > not_correct_weight </ ReasonsForNotCompleting >

    < TotalPigsOnFarm > 0 < / TotalPigsOnFarm >

    < TotalDrySowsFinishingPigsOnFarm > 0 < / TotalDrySowsFinishingPigsOnFarm >

    < SowsOrPigs > Finishing_pigs </ SowsOrPigs >

    < PercentageDeathBatch > 0.0 < / PercentageDeathBatch >

    < PercentageCullsBatch > 0.0 < / PercentageCullsBatch >

    < PercentageDeath12Months > 0.0 < / PercentageDeath12Months >

    < PercentageCulls12Months > 0.0 < / PercentageCulls12Months >

    < BatchStartAge > 0 < / BatchStartAge >

    < BatchStartWeight > 0 < / BatchStartWeight >

    < BatchEndWeight > 0 < / BatchEndWeight >

    < UndockedPigsPresent > fake </ UndockedPigsPresent >

    < EarBiting > fake </ EarBiting >

    < FlankBiting > fake </ FlankBiting >

    < FurtherCare > 0 < / FurtherCare >

    < NoLame > 0 </ NoLame >

    < NoSkinCondition > 0 < / NoSkinCondition >

    < NoBodyWounds > 0 < / NoBodyWounds >

    < NumberTraumaticInjury > 0 < / NumberTraumaticInjury >

    < TooDirtyToAssess > 0 < / TooDirtyToAssess >

    < ManureScore0 > 0 < / ManureScore0 >

    < LegSwellingScore0 > 0 < / LegSwellingScore0 >

    < SkinScore0 > 0 < / SkinScore0 >

    <SkinTooDirtyToAssess>0< /SkinTooDirtyToAssess>

    < Lameness > 0 </ Boiterie >

    < TailLesionsNone > 0 < / TailLesionsNone >

    < WoaID > 4198 </ WoaID >

    < VisitType > Inspection </ VisitType >

    < FFRegNo > 0541.0068 < / FFRegNo >

    < Producer > Farm Hyatt hotel </ Producer >

    < VisitDate > 2014-10 - 08T 23: 00:00.000Z </ VisitDate >

    < CompletionDate > 2014-10 - 28 T 00: 00:00.000Z </ CompletionDate >

    < SpeciesType > Pigs </ SpeciesType >

    < RenewalDate > 2015-12 - 01 T 00: 00:00.000Z </ RenewalDate >

    < CompletingWOA > no </ CompletingWOA >

    < WantsAdvice > fake </ WantsAdvice >

    < AgreesToThirdPartyDataUse > fake </ AgreesToThirdPartyDataUse >

    < Completed > fake </ Completed >

    < ModifiedAfterCompletion > fake </ ModifiedAfterCompletion >

    < Imported > fake </ Imported >

    - < WOA_SpeciesType >

    - < SpeciesType >

          < SpeciesTypeDescription > Pigs </ SpeciesTypeDescription >

       </ SpeciesType >

    </ WOA_SpeciesType >

    < WOA_Units >

        - < Units of >

              < UnitDescription > Pig farm unit </ UnitDescription >

          </ Units of >

    </WOA_Units>

    - < WOA_AssessorMonitor >

         - < AssessorMonitor >

              < E-mail > m[email protected]< / Email >

              < Phone > 01798 742863 </ Phone >

              < Mobile > 07797 121289 </ Mobile >

              < FullASName > Mike Church </ FullASName >

          </ AssessorMonitor >

    < / WOA_AssessorMonitor >

      - < Assessments_WOA >

        - < Assessments >

             < AssessmentID > 127561 < / AssessmentID >

             < AssessmentType > Renewal </ AssessmentType >

             < AssessmentDueDate > 2014-07 - 29 T 23: 00:00.000Z </ AssessmentDueDate >

             < FLORequestTimeframe > 0 < / FLORequestTimeframe >

             < Revisits > fake </ Revisits >

             < RevisitRequestTimeframe > 0 < / RevisitRequestTimeframe >

             < LastMembershipAssessment > 2013-04 - 29 T 23: 00:00.000Z </ LastMembershipAssessment >

             < ProducerName > Farm Hyatt hotel </ ProducerName >

       - < Assessments_AssessmentStatus >

            - < AssessmentStatus >

              < Description > The evaluator allocated </ Description >

              </ AssessmentStatus >

         </ Assessments_AssessmentStatus >

      </ Assessments >

    < / Assessments_WOA >

    < / WS_ResultWoaFinishingPigs >

    + < WS_ResultWoaFinishingPigs >

    + < WS_ResultWoaFinishingPigs >

    + < WS_ResultWoaFinishingPigs >

    + < WS_ResultWoaFinishingPigs >

    < / TNS:GetWOAFinishingPigsResponse >

    I can interrogate pieces of data, for example the following will give me a list of all producers of each repeated item (5 in total)

    Extractvalue SELECT (value (x), ' / producer ') producer

    DE P "GetWOAFinishingPigsRe1711_TAB."

    TABLE (XMLSequence (EXTRACT of(p.object_value, ' tns:GetWOAFinishingPigsResponse/WS_ResultWoaFinishingPigs/producer', ' xmlns:tns ="Http://localhost: 8085/WS_WoaFinishingPigs_GetAllData" ' ""))) x

    My question is, can I adapt the code above to include several items? If I could go back to tell the producer and the visitdate? I tried with the following text:


    Extractvalue SELECT (value (x), ' / producer ') producer.

    ExtractValue (value (y), ' / VisitDate') dated

    DE P "GetWOAFinishingPigsRe1711_TAB."

    TABLE (XMLSequence (EXTRACT of(p.object_value, "tns:GetWOAFinishingPigsResponse/WS_ResultWoaFinishingPigs/producer" ', ' xmlns:tns = 'Http://localhost: 8085/WS_WoaFinishingPigs_GetAllData"'"))) x,.

    TABLE (XMLSequence (EXTRACT (p.object_value, ' tns:GetWOAFinishingPigsResponse/WS_ResultWoaFinishingPigs/VisitDate', ' xmlns:tns = "Http://localhost: 8085/WS_WoaFinishingPigs_GetAllData"'))),

    But I get the following results:

    Hyatt Hall Farm2014 07-16 T 23: + 00:00 00:00.000000
    Hyatt Hall Farm2014-10 - 05T 23: + 00:00 00:00.000000
    Hyatt Hall Farm2014 09-30 T 23: + 00:00 00:00.000000
    Hyatt Hall Farm2014 10-23 T 23: + 00:00 00:00.000000
    Hyatt Hall Farm2014-10 - 08T 23: + 00:00 00:00.000000
    Farm Redishill2014 07-16 T 23: + 00:00 00:00.000000
    Farm Redishill2014-10 - 05T 23: + 00:00 00:00.000000
    Farm Redishill2014 09-30 T 23: + 00:00 00:00.000000
    Farm Redishill2014 10-23 T 23: + 00:00 00:00.000000
    Farm Redishill2014-10 - 08T 23: + 00:00 00:00.000000
    Hokeham real estate2014 07-16 T 23: + 00:00 00:00.000000
    Holkham estate2014-10 - 05T 23: + 00:00 00:00.000000
    Hokeham real estate2014 09-30 T 23: + 00:00 00:00.000000
    Hokeham real estate2014 10-23 T 23: + 00:00 00:00.000000
    Hokeham real estate2014-10 - 08T 23: + 00:00 00:00.000000
    Avon farm2014 07-16 T 23: + 00:00 00:00.000000
    Avon farm2014-10 - 05T 23: + 00:00 00:00.000000
    Avon farm2014 09-30 T 23: + 00:00 00:00.000000
    Avon farm2014 10-23 T 23: + 00:00 00:00.000000
    Avon farm2014-10 - 08T 23: + 00:00 00:00.000000
    Newtown2014 07-16 T 23: + 00:00 00:00.000000
    Newtown2014-10 - 05T 23: + 00:00 00:00.000000
    Newtown2014 09-30 T 23: + 00:00 00:00.000000
    Newtown2014 10-23 T 23: + 00:00 00:00.000000
    Newtown2014-10 - 08T 23: + 00:00 00:00.000000

    How can I refine the code so that I get a producer and it is own visitdate?

    Any help would be appreciated.

    Thank you

    JP

    Hello

    The usefulness of the TABLE/XMLSEQUENCE is specifically to target the repetitive elements, but in your attempt, you are targeting a node without issue.

    Just stop the path to WS_ResultWoaFinishingPigs:

    SELECT extractvalue(value(x), '/WS_ResultWoaFinishingPigs/Producer') Producer
         , extractvalue(value(x), '/WS_ResultWoaFinishingPigs/VisitDate') Dated
    FROM "GetWOAFinishingPigsRe1711_TAB" p
        , TABLE(
             XMLSequence(
                EXTRACT( p.object_value
                       , 'tns:GetWOAFinishingPigsResponse/WS_ResultWoaFinishingPigs'
                       , 'xmlns:tns="http://localhost:8085/WS_WoaFinishingPigs_GetAllData"'
                       )
                )
          ) x
    ;
    

    Although not discouraged in your version, XMLSequence extractvalue and like are 11.2.

    If you start with XMLTable. I'm sure that you will find it much easier and easier to maintain:

    SELECT x.*
    FROM "GetWOAFinishingPigsRe1711_TAB" p
        , XMLTable(
            XMLnamespaces('http://localhost:8085/WS_WoaFinishingPigs_GetAllData' as "tns")
          , '/tns:GetWOAFinishingPigsResponse/WS_ResultWoaFinishingPigs'
            passing p.object_value
            columns producer  varchar2(30)              path 'Producer'
                  , visitdate timestamp with time zone  path 'VisitDate'
          ) x
    ;
    

    BTW, since you're apparently using object-relational storage, I also suggest that you rename the xmltype table using an identifier without quotes of your choice.

  • Using EXTRACT XML data extraction

    Hi, I have a XML file where I want to analyze the fields in a table in DB:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < FIXML > < batch > < MktDataFull BizDt = '2012-07-13' > < Instrmt Sym = "JCPRXU" ID = "JCPRXU" Desc = "JCP.SR. XR. «USD"SecTyp ="CD"Src ="H"subtype = MMY" S "="201209"MatDt = ' 2012-09-20" Mult = Exch "0.01" = "CMD" UOM = "CTL" UOMCcy = "USD" UOMQty = "1" PxUOM = "IPNT" ValMeth = "CD" CpnRt = "1.0" IntAcrl = ' 2012-06-20 ' CpnPmt = ' 2012-09-20 ' NotnlPctOut = "100.0" Snrty = 'SR' RstrctTyp = 'XR' DayCntMeth = "ACT/360" tenor = "0 M" > < DITTA HELP = "US708130AC31" AltIDSrc = "105" / > < HELP AltID = "JCP.SR." "" ""» XR. USD.12U.100"AltIDSrc ="101"/ > < HELP DITTA = '1 201209 JCPRXU' AltIDSrc = 'H' / > < DITTA HELP ="1 201209 JCPRXU"AltIDSrc ="100"/ > < Evnt EventTyp ="5"Dt ="2008-09-19"/ > < Evnt EventTyp = '7' Dt = '2012-09-19' / > < Evnt EventTyp ="19"Dt ="2012-10-05"/ > < Evnt EventTyp ="100"Dt ="2012-07-16"/ > < Evnt EventTyp = '8' Dt ="2012-07-14"/ > < Evnt EventTyp = '9' Dt = '2012-09-20' / > < Evnt EventTyp ="101"Dt = '2012-03-20' / > < Evnt EventTyp ="102"Dt ="2008-09-20"/ > < Evnt EventTyp = « 103 » Dt = « 2008-09-22 » / >< Evnt EventTyp = « 104 » Dt = « 2012-09-19 » / >< Evnt EventTyp = « 111 » Dt = « 2012-09-20 » / >< Evnt EventTyp = « 112 » Dt = « 2012-06-20 » / >< Evnt EventTyp = « 113 » Dt = « 2012-03-20 » / >< Evnt EventTyp = « 114 » Dt = « 2012-07-12 » / >< Evnt EventTyp = « 115 » Dt = « 2012-07-16 » / >< / Instrmt >< complet Typ = « 6 » Px = Mkt « 99.7433368 » = « CMD » QCond = « 6 » PxTyp = « 1 » OpenClsSettlFlag = « 1 » >< / Full >< complet Typ = « 6 » Px = « 234.5254 » Mkt = QCond « CMD » = « 6 » PxTyp = « 6 » ' OpenClsSettlFlag = '1' > < / Full > < full Typ = "Y" Px = Mkt "40.0" = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1' > < / Full > < full Typ = '6' Px = "234.5212" Mkt = QCond 'CMD' = '7' PxTyp = '6' OpenClsSettlFlag = '1' > < / Full > < full Typ = Mkt "B" = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full type = 'C' Mkt = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full Typ = 'z' Px = Mkt '0.18' = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1 '. > < / full > < full Typ = 'y' Px = "0.1899965" Mkt = QCond 'CMD' = '6' PxTyp = '5' OpenClsSettlFlag = '1' > < / Full > < InstrmtExt > < Attrb Typ = '100' Val = '24' / > < Attrb Typ = '101' Val = '0' / > < Attrb Typ = '109' Val = '0' / > < Attrb Typ = '103' Val = '24' / > < Attrb Typ = '102' Val = '24' / > < Attrb Typ = '110' Val = '3' / > < Attrb Typ = '29' Val = 'Y' / > < Attrb Typ = '112' Val = 'Y ' /. > < / InstrmtExt > < / MktDataFull > < / batch > < / FIXML >


    Right now, I'm just trying to extract the first 3 fields, BizDt, Bal and id I use to analyze the following:


    SELECT
    Extract (value (p), '/BizDt') .getStringVal () AS DATE_,.
    Extract (value (p), ' /Instrmt/Sym').getStringVal (AS SYMBOL),)
    Extract (value (p), ' /Instrmt/ID').getStringVal () AS ID_)

    OF s TABLE_NAME.
    TABLE (XMLSEQUENCE (Extract (xmlType.createXml (s.CDS_CLOB), ' FIXML/batch/MktDataFull / *'))) p
    WHERE s.ID_ = 1

    But I get nothing back. My guess is the because the XML data does not have opening tags and formal closing, because if I change my XML like this:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < FIXML > < batch > < MktDataFull > < BizDt > 2012 - 07 - 13 < / BizDt > < Instrmt > < Sym > JCPRXU < / Sym > < ID > JCPRXU < /ID > < Desc > JCP.SR. XR. USD < / Desc > < SecTyp > CD < / SecTyp > < / Instrmt > < / MktDataFull > < / batch > < / FIXML >

    I was able to get the data. Therefore, in order so solve this problem, what should I do with my original XML? Can I format the tags?

    Thank you

    When you nest xsl: for each of the elements, the select expression is evaluated in the context of the enclosing instance.

    Consider this:

    
      
    

    This means you are trying to match items complete as children Instrmt, that is not correct, because they are actually siblings.
    In the same goes for HELP, Evnt etc.

    I don't know what kind of structure you want.
    Caps all does not much sense given that groups of brothers of repeat items that have no apparent correlation between them. Essentially, you end up with a big Cartesian product.

    I would approach this by storing repeated elements in different tables with a parent/child relationship to preserve the hierarchical nature of the data (if necessary).

  • Windows Media Player - how to set the repeat function?

    I set a schedule to play music using Windows Media Player, if I set the repeat function, then it will play the file audio repeatly, but first I would annex plays a sound at a specific time only once without repeat and play another his repeatly at another time, someone has suggestions on how to set this option on the calendar?

    Thanks in advance for your suggestions

    Hello

    What version of Windows Media Player you have installed?

    Try to create individual selections with each audio file. Later, try using the repeat function.

    If you use Windows Media Player 11, you can follow this link.

    Shuffle and repeat items in Windows Media Player


    Reference:
    How to schedule tasks in Windows XP

    Hope the helps of information.

    Please post back and we do know.

  • How can I stop the CD / DVD automatically repeat playback?

    Don't want to cd / dvd, loop playback.

    Hello

    What player you use to play a cd / dvd?

    If you use Windows media player, I suggest you go through the following method.

    Stir and repeat items in Windows Media Player.

    http://Windows.Microsoft.com/en-us/Windows7/shuffle-and-repeat-items-in-Windows-Media-Player

  • Extraction of extensible in PL/SQL SOAP envelope group

    Hi all.

    I have the following in an XMLTYPE variable in PL/SQL SOAP envelope.

    <? XML version = "1.0" encoding = "UTF - 8"? >
    < env:Envelope xmlns:env = "http://schemas.xmlsoap.org/soap/envelope/" container = "http://www.w3.org/2001/XMLSchema" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0 = "http://elmarwsoicdvmws/types/" >
    < env:Body >
    < ns0:getDVMValuesResponseElement >
    < ns0:result >
    < ns0:dvmValues > 10 < / ns0:dvmValues >
    < ns0:dvmValues > 11 < / ns0:dvmValues >
    < ns0:dvmValues > 12 < / ns0:dvmValues >
    < ns0:errorText > Ok < / ns0:errorText >
    < ns0:errorCode > 0 < / ns0:errorCode >
    < / ns0:result >
    < / ns0:getDVMValuesResponseElement >
    < / env:Body >
    < / env:Envelope > '

    I can extract the code of error and ErrorText variable without too much effort (even if I don't know there are easier ways), but now I have to extract the repeating group of dvmValues in a variable of type table.

    Any ideas/code snippets would be greatly appreciated, as I've read tons of docs and half the time they are too complex or too simplistic (given my ns0: variables), and it seems that many functions I use have been depricated.

    Kind regards

    Elmar

    Hi Elmar,

    Using a separate function to analyze the individual nodes is not necessary.
    You can extract all with a single query, thus eliminating the need to access the same document several times.

    For example, once you have the content in the RESP xmltype variable, you can do:

    SQL> create type dvmValues_t as table of number;
      2  /
    
    Type created
    
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2
      3    resp         xmltype;
      4    v_errorText  varchar2(2000);
      5    v_errorCode  number;
      6    v_dvmValues  dvmValues_t;
      7
      8  BEGIN
      9
     10    resp := xmltype('
     11  
     12  
     13  
     14  
     15  10
     16  11
     17  12
     18  Ok
     19  0
     20  
     21  
     22  
     23  ');
     24
     25    select x.errorText
     26         , x.errorCode
     27         , cast(
     28             multiset(
     29               select dvmValue
     30               from xmltable('*' passing x.dvmValues
     31                                 columns dvmValue number path '.')
     32             )
     33             as dvmValues_t
     34           )
     35    into v_errorText
     36       , v_errorCode
     37       , v_dvmValues
     38    from xmltable(
     39           xmlnamespaces(
     40             'http://schemas.xmlsoap.org/soap/envelope/' as "env"
     41           , default 'http://elmarwsoicdvmws/types/'
     42           )
     43         , '/env:Envelope/env:Body/getDVMValuesResponseElement/result'
     44           passing resp
     45           columns
     46             errorText  varchar2(2000)  path 'errorText'
     47           , errorCode  number          path 'errorCode'
     48           , dvmValues  xmltype         path 'dvmValues'
     49         ) x
     50    ;
     51
     52    dbms_output.put_line('Error Text = ' || v_errorText);
     53    dbms_output.put_line('Error Code = ' || v_errorCode);
     54
     55    for i in 1..v_dvmValues.count loop
     56      dbms_output.put_line('Value(' || to_char(i) || ') = ' || v_dvmValues(i));
     57    end loop;
     58
     59  END;
     60  /
    
    Error Text = Ok
    Error Code = 0
    Value(1) = 10
    Value(2) = 11
    Value(3) = 12
    
    PL/SQL procedure successfully completed
     
    
  • How to extract 3 or n - th element of a string separated by commas

    Hello

    Let's say I have a string "oracle, java, .net, perl, basic, html.
    and I want to extract the 4th item.

    Please guide me

    Thanks in advance

    Try this

    http://nimishgarg.blogspot.com/2010/06/Oracle-nth-record-from-comma-seprated.html

    for example:
    SELECT REGEXP_SUBSTR(MYCOL, '[^,]+', 1, *4*) AS VAL
    Of
    (
    SELECT 'oracle, java, .net, perl, basic, html.
    AS DOUBLE MYCOL.
    )

    Alexander gelin
    http://nimishgarg.blogspot.com/

  • By passing a value &lt; mx:Repeater &gt; to a click function

    Hello everyone.

    I just started using Flex and encountered a problem when parsing of an XML file in a flex application.

    Everything works fine, it's just a tiny part of few of my application, I can't understand, I can't find a solution via Google:

    < mx:Repeater id = dataProvider = "{entries.currentItem.elements ('events')}" >
    < mx:Text text = "{events.currentItem.name}" click = "navigateToURL (new URLRequest (events.currentItem.url), '_blank')" / > ""
    < / mx:Repeater >

    FlexBuilder shows any errors, and the Application runs fine until I click on this text.

    Can I get an errormessage from the currently running Flash application:

    TypeError: Error #1010: a term is undefined and has no properties.

    I tried many things to pass the " " ' events.currentItem.url ' value (that I have read in an XML file) for this Actionscript. Nothing seems to work. Is it still possible?

    I tried other things:

    "{click =" {}navigateToURL (new URLRequest (events.currentItem.url), '_blank')}"

    No error in Flex, same error in live app. As far as I can tell it's the same thing anyway.

    a click = "navigateToURL (new URLRequest ({} {events.currentItem.url}), '_blank')" "

    FlexBuilder error since the value click area already is Actionscript, right?

    a click = "navigateToURL (new URLRequest ('http://www.test.com'), '_blank')" "

    URL hardcoded that works very well, but does not help me because I need the URL from the XML

    Can someone help or offer a simple alternative?

    Thank you very much!


    Hello

    After the end of a repeat repeat element, do not use the Repeater.currentItem property to get the current item. Instead, call the getRepeaterItem() of the repeated item itself.

    Change your handler like this

    function OnClickText(e:Event):void {}

    var strUrl:String = event.currentTarget.getRepeaterItem (.url);

    navigateToURL (new URLRequest (strUrl), '_blank');

    }

  • How to get the id of the button component repeater

    I want to get or set the id of the button component repeater:

    < mx:Repeater id = dataProvider = "{xmldata.lastResult.names.name"repeaterData"}" >
    < mx:Button label = "{repeaterData.currentItem}" id = "{repeaterData.currentIndex}" / > "
    < / mx:Repeater >


    ID = "{repeaterData.CurrentIndex}" does not work because currentIndex returns int. "

    Please, is there a possible way to get id?

    "Amy Blankenship" wrote
    in the message news:[email protected]...
    >
    > "Borooooon" wrote in message
    > news:[email protected]...
    > I would like to get or set the id of the button component repeater:
    >>
    >>
    > dataProvider = "{xmldata.lastResult.names.name}" > "
    >>
    > id = "{repeaterData.currentIndex}" / >
    >>
    >>
    >>
    > id = "{repeaterData.currentIndex}" does not work because currentIndex "
    > returns
    > int value.
    >>
    > Please, is there any possible way to get id?
    >>
    >
    > Q: I use a Repeater to draw the right number of components
    > on the screen for me based on a data source. I'm trying to implement the id
    > for each component dynamically like this:
    >
    >
    >
    > label = "{myRepeater.currentItem.label}" / > "
    >

    >
    > When I try to run the file, I get a compiler error
    > ' {'myButton' + myRepeater.currentIndex}' is not a valid identifier.
    >
    > I need to be able to reference each of the repeated items. How can I
    > to do this?
    >
    >
    >
    > R: If you give the component an ordinary id like this:
    >
    > Flex will create a table for you called myButton that contains a
    > reference to each created Repeater component. For more information,.
    > See referencing the components created here:
    > http://livedocs.adobe.com/flex/3/html/help.html?content=repeater_3.html
    >
    > Amy Flex FAQ. This FAQ is posted weekly and the latest version
    > this FAQ is always available here (he found this Q has been added
    (> this week, so it was not displayed this Modnay):
    >
    > http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

    Correction: which can be made "repeated referencing.

    HTH;

    Amy

  • Make state transitions within a component of DataList

    I have a datalist that includes a word bubbles title, data and long list of text for each line in the list of data. I want this to appear as the title, date and a word bubble extracted text. When the user clicks on it, I want the text box expand to show more text. To do this, I went into the isolation of the repeated item mode. In the "Selected" State, I enlarged the text box and made a smooth transition. It works exactly as I want it. Now, I want to click a button box and the box shrink to the way it is 'normal '.  However, when I try to add an interaction to the button while in the 'selected' State the menu interactions I cannot choose a State play transition to and the ok button is grayed.  Once the user clicks on the text, he enlarged and is now frozen this way that I'm not able to add a way to transition to the 'normal' State

    The reason seems to be that if you are in a 'normal' State, you can easily select the 'selected' State However, there is no natural transition of the "selected" back to 'normal '.

    Hi infomotive,

    The logic that controls which list item is selected is determined by the selectedIndex from the list. When you click an item, selectedIndex of the list has the index value of that element, which puts the appropriate in repeated item in turn has "selected" State (and puts the previously selected item in its 'Normal' State). All this is done for you by Flex, and you cannot directly control the State of a repeated element (or, in fact, no matter which component skin!). In order to state of an item to 'Normal', you set selectedIndex from the list to not be the point.

    You can do this by creating an action sequence with effect of the value of property that affects the selectedIndex property of the list - 1 (which means that nothing is selected). Unfortunately, this is impossible within the repeated element itself because the interaction Panel won't let you target objects that are at the top of the hierarchy of the source of the event! So actually there is no right way to do what you want to do in the last version of Flash Catalyst. However, it is quite easy in Flash Builder:

    -Adam

  • express mail Outlook - sending 16 copies of each email

    When I send a picture or messages, it sends copy 16? down load antiviruse scanning whole c.p found nothing [3: 00 scanner] what can I do to stop this [outlook express] to down load Paolo cleaner / you can call: say that they can help me, but I have to pay the guys at tec? / i them are already paying for protech my p.c.now they want more money. !!!! I need help please!

    Hello

    -Did you change your computer, after which the question began?

    There are two causes:

    Anti-malware tools:

    The most common cause of repeated items dating back to your real e-mail program is probably anti-malware tools that try to sweep the outgoing email, or interfere with the correct functioning of the mail program. It is a common cause of repeated downloads (or failures) of e-mail, and when the feature is activated to parse messages, it can interfere here as well.

    According to the type of intervention, the e-mail program responds by saying: "well, that didn't work, I'll try to send again"- and again and again.

    Step 1:

    The solution here is pretty simple: locate this function in your suite antivirus or security and turn it off. You will need to close and restart your e-mail program or even restart your machine for the change to take effect.

    Note: Activate the anti-malware after the test.

    Outlook Express mailbox limits:

    Outlook Express apparently has a size limit of 2 GB file for the mailboxes.

    Normally, this does not affect the majority of people, but I've certainly seen reports to do exactly what you described, as the sent items folder approach 2 gigabytes. Small mails could do for a while, but a greater commitment could be enough to exceed this size limit and therefore cause the problem.

    Step 2:

    My recommendation is to create a new folder - call it what you like; Maybe, something like "SentArchive" and move all messages in your sent items in the Archive folder file sent. Who should;

    (a) keep all your messages if you need to refer to them.
    (b) empty the sent items folder so that this problem does not happen.

    Step 3:

    a. your Outlook Express, learned to tools > accounts > mail tab.
    b. double-click the account name > Advanced tab.
    c. only uncheck the box marked "Break apart messages.

Maybe you are looking for