Pls help Cartesian Join

<PODetails>
- <POHeader>
<CurrencyID>INR</CurrencyID>
<ExchangeRate>1</ExchangeRate>
<RefNo>0080000110</RefNo>
<VendorID>1200</VendorID>
<TransDate>2006-12-20</TransDate>
<DocRelationshipId>PURCHASE</DocRelationshipId>
<LocationID>0000102327</LocationID>
</POHeader>
- <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>L HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>3.000</Quantity>
<PriceValue>2509.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
- <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>M HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>2.000</Quantity>
<PriceValue>1673</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
- <POItemDetails>
<ItemID>ARSH1556</ItemID>
<Size>39FS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>1.000</Quantity>
<PriceValue>836.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POHeader>
<CurrencyID>INR</CurrencyID>
<ExchangeRate>1</ExchangeRate>
<RefNo>0080000110</RefNo>
<VendorID>1200</VendorID>
<TransDate>2006-12-20</TransDate>
<DocRelationshipId>PURCHASE</DocRelationshipId>
<LocationID>0000102327</LocationID>
</POHeader>
+ <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>L HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>3.000</Quantity>
<PriceValue>2509.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>M HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>2.000</Quantity>
<PriceValue>1673</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POItemDetails>
<ItemID>ARSH1556</ItemID>
<Size>39FS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>1.000</Quantity>
<PriceValue>836.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POHeader>
<CurrencyID>INR</CurrencyID>
<ExchangeRate>1</ExchangeRate>
<RefNo>0080000110</RefNo>
<VendorID>1200</VendorID>
<TransDate>2006-12-20</TransDate>
<DocRelationshipId>PURCHASE</DocRelationshipId>
<LocationID>0000102327</LocationID>
</POHeader>
+ <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>L HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>3.000</Quantity>
<PriceValue>2509.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POItemDetails>
<ItemID>ARSH1332</ItemID>
<Size>M HS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>2.000</Quantity>
<PriceValue>1673</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
+ <POItemDetails>
<ItemID>ARSH1556</ItemID>
<Size>39FS</Size>
<Quality>Q1</Quality>
<UOM>PC</UOM>
<Quantity>1.000</Quantity>
<PriceValue>836.5</PriceValue>
<TaxAmount>0.00</TaxAmount>
</POItemDetails>
</PODetails>
Query -
SELECT extract(value(d), '//CurrencyID/text()').getStringVal() AS CurrencyID,
extract(value(d), '//ExchangeRate/text()').getStringVal() AS ExchangeRate,
     extract(value(d), '//RefNo/text()').getStringVal() AS RefNo,
     extract(value(d), '//VendorID/text()').getStringVal() AS VendorID,
     extract(value(d), '//TransDate/text()').getStringVal() AS TransDate,
     extract(value(d), '//DocRelationshipId/text()').getStringVal() AS DocRelationshipId,
     extract(value(d), '//LocationID/text()').getStringVal() AS LocationID,
     extract(value(z), '//ItemID/text()').getStringVal() AS ItemID,
     extract(value(z), '//Size/text()').getStringVal() AS Size_cd ,
extract(value(z), '//Quality/text()').getStringVal() AS Quality,
     extract(value(z), '//UOM/text()').getStringVal() AS UOM,
     extract(value(z), '//Quantity/text()').getStringVal() AS Quantity,
     extract(value(z), '//PriceValue/text()').getStringVal() AS PriceValue,
     extract(value(z), '//TaxAmount/text()').getStringVal() AS TaxAmount
FROM xml_raw x,table(xmlsequence(extract(value(x), '//PODetails/POHeader'))) d,
table(xmlsequence(extract(value(x), '//POItemDetails'))) z
I am getting 3*3*3 = 27 rows
I would have to get only
3*3 rows.
Pls Help
regds,
Santhoshkumar.G.

Please see my response to your previous post on this subject.
#1. STOP BEING LAZY by using '//' in your XPath expressions
#2 Get your aliases correct. The input to the second XML Sequence is the output of the first XML Sequence not the original document.
Message was edited by:
mdrake

Similar Messages

  • Grus help needed in finding the queries with Cartesian  joins

    Hi
    I have a reporting tool in which users are allowed to put the joins on the views and add some sub queries that produces a Cartesian product. Is there any tool or way that I can stop the execution of those query before it is being executed for example
    Step 1 ) user creates a query
    step2 ) user submits it
    step 3) by any tool or any check if Cartesian join is found the query execution is stopped and notify the user that the query is not good if no problem executes the query.
    I really need help in step 3. I am on 9i release2.
    Any help or suggestions will be highly appreciated.

    I Agree with Gasparotto, you should limit the resource consume.
    You must understand that cartesian join, isn´t always a BAD guy, sometimes you need it.
    If your developers are in trouble with handle the join , think about NATURAL JOIN, may be it helps you
    Regards
    Helio Dias

  • Could anyone help me to avoid Cartesian join in this query?

    Hi, guys:
    Could you help me on this query? I must generate a Cartesian join, but I do not know why it happens. dt.debtorkey, cl.clientkey, inv.invoicekey, ag.agingkey are primary keys of each table. The problem is: I got same tuple for 8 times.
    select dt.debtorkey, cl.clientkey,  inv.invoicekey, ag.agingkey, dt.DebtorNo, dt.Name as "debtor Name", dt.State,  cl.ClientNo, cl.Name as "Client Name",  inv.InvNo, inv.PurchOrd, inv.Amt,
    to_char(inv.InvDate, 'MM-DD-YY') invoice_date,  to_char(ag.DateLastBuy, 'MM-DD-YY') aging_lastbuy, to_char(ag.DateLastPmt, 'MM-DD-YY') aging_lastpmt
    from aging ag, invoices inv, debtors dt, clients cl
    where ag.clientkey=cl.clientkey
    and ag.debtorkey=dt.debtorkey
    and inv.clientkey=cl.clientkey
    and inv.debtorkey=dt.debtorkey
    and ((inv.InvDate>=to_date(:P16_DP_IDF_START_DATE, 'MM/DD/YYYY')
    and inv.InvDate<=to_date(:P16_DP_IDF_END_DATE, 'MM/DD/YYYY')
    and ag.DateLastBuy=to_date(:P16_DP_IDF_LAST_BUY,'MM/DD/YYYY')
    order by dt.name;Thanks a lot!

    Hi,
    Thanks for help. I am sorry for that I do not know how to upload a picture of explain plan. I am struggling to find how to provide sample data. I hope this data format could be at least useful.
    "DEBTORKEY","CLIENTKEY","INVOICEKEY","AGINGKEY","DEBTORNO","debtor Name","STATE","CLIENTNO","Client Name","INVNO","PURCHORD","AMT","INVOICE_DATE"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744212,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960590","LK1-17225",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744213,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960591","LK1-17241",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"
    8,2741,744214,276807,"0538","MJN Services, Inc.","UT","2696","Pompano Logistics, LLC","26960592","LK1-17224",1700,"09-25-12"I do not know why the tuples with same primary key repeat 8 times.
    Edited by: lxiscas on Oct 24, 2012 4:08 PM
    Edited by: lxiscas on Oct 24, 2012 4:10 PM

  • Report containing details of Payment released to Vendor -----PLS HELP ME

    Hi All,
    Pls Help me .
    My client asking create new report.
    they gave some fields also.
    But, problem is my abap people asking which table will come data.
    but i didn't have idea which table its take output.
    pls help me
    <<< Vendor Code >>>
    <<< Vendor Name >>>
    <<< Vendor Address >>>
    <<< Vendor City >>>
    Please find enclosed the details of payments released to you from << from selection date >> to << upto selection date >>
    Document No     
    Cheque no     Date of Release
    Vendor Invoice no
    Vendor Invoice Passed for (MIRO Value)
    PO no.     
    Basic Rate from PO     
    GR No.     
    Material & Description     
    Qty Invoiced (MIRO qty)     
    Qty Received (MIGO qty)
    in above 4 feilds related to FI .
    Pls help me what are the table can i give
    thanks
    supriya

    hi,
    select table ADRC:
    sample (join with lfa1)
          SELECT name1 city1 post_code1 street
                 INTO CORRESPONDING FIELDS OF ITAB
                 FROM ADRC AS A INNER JOIN LFA1 AS L
                  ON  AADDRNUMBER = LADRNR
                  WHERE L~LIFNR = P_LIFNR
                   AND A~DATE_TO  GE SY-DATUM.
    or use one of the function modules from my 1st post
    plz reward usefule answers
    thanx and regards
    Andreas

  • BB Curve 8320 Software needed! pls help

    Im a BB 8320 Curve user. Software version 4.2.2.180 (Platform 2.5.0.36) T-mobile user. I need to download this version bcoz i've upgraded to OS 4.5 but im didnt liked dat much. So i want to switch to 4.2.2.180 (Platform 2.5.0.36) but didnt get this version anywhere. Pls help me friends...!!!
    Solved!
    Go to Solution.

    Hi and Welcome to the Forums!
    All carriers official versions are available via this portal:
    http://na.blackberry.com/eng/support/downloads/download_sites.jsp
    I've no idea which carriers have the version you desire...you'll have to dig through to find it.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Xml issues - cartesian join

    HI, I have an XMLType column that has the following XML structure:
    <Client>
    <Report id = "01">
    <Item id = "01" Description = ",a.mdfbnelt;yuk" </Item>
    <Item id = "02" Description = "AAAAA;yuk" </Item>
    <Item id = "03" Description = "XXXXX" </Item>
    </Report>
    <Report id = "02">
    <Item id = "01" Description = ",ABCDEF" </Item>
    <Item id = "02" Description = "JHIKLM" </Item>
    <Item id = "03" Description = "OPQRST" </Item>
    </Report>
    </Client>
    I would like to extract and insert data into the following file
    Table MyTable(Client, Report_id, Item_id, Description)
    So I created the following query
    SELECT
    extractValue(VALUE(x), '/Client/@id')) Client,
    extractValue(VALUE(d), '/Report/@id') Report,
    extractValue(VALUE(e), '/Item/@id') Description,
    extractValue(VALUE(e), '/Item/@Description) Description
    FROM XMLDOC2 x,
    TABLE(xmlsequence(extract(VALU*E(x), '/Client/Report'))) d,
    TABLE(xmlsequence(extract(VALU*E(x), '/Client/Report/Item'))) e
    But I get the cartesian product of the reports and the items. I would
    like to get the items related to a reports AND the report id on the
    same line. If it is not possible, I would like to filter out the items
    belonging to report; some kind of where clause.
    Anybody has an idea?
    regds,
    Santhoshkumar.G.

    -- Xml format
    <ITEMLIST>
    <ITEM>
    <EXTERNALID>ARSH0001</EXTERNALID>
    <DESCRIPTION>WHITE DIAGEO SHIRT</DESCRIPTION>
    <MATYPE>ZFGM</MATYPE>
    <TAXCD>1</TAXCD>
    <BRANDID>AR</BRANDID>
    <UOMID>PC</UOMID>
    <PRODUCTHIERARCHY>METOPSSHFASHN00895</PRODUCTHIERARCHY>
    <MANUFACTURER1>FASHION</MANUFACTURER1>
    <COLOR>WHITE</COLOR>
    <THEME></THEME>
    <COLLECTION>empty</COLLECTION>
    <FIT></FIT>
    <SEASON>S06</SEASON>
    <PRDGRP>SH</PRDGRP>
    <PRDCOLL>TOPS</PRDCOLL>
    <TARGET>ME</TARGET>
    <GRID>GRID01</GRID>
    <SUBITEM size="38FS" quality="Q2" barcode="100051050" price=" 895.00"></SUBITEM>
    <SUBITEM size="38FS" quality="Q3" barcode="100051051" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q2" barcode="100051052" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q3" barcode="100051053" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q2" barcode="100051054" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q3" barcode="100051055" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q2" barcode="100051056" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q3" barcode="100051057" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q2" barcode="100051058" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q3" barcode="100051059" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q2" barcode="100051060" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q3" barcode="100051061" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q2" barcode="100051062" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q3" barcode="100051063" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q1" barcode="8901208428516" price=" 895.00"></SUBITEM><SUBITEM size="40FS" quality="Q1" barcode="8901208428523" price=" 895.00"></SUBITEM><SUBITEM size="42FS" quality="Q1" barcode="8901208428530" price=" 895.00"></SUBITEM><SUBITEM size="44FS" quality="Q1" barcode="8901208428547" price=" 895.00"></SUBITEM><SUBITEM size="46FS" quality="Q1" barcode="8901208428554" price=" 895.00"></SUBITEM><SUBITEM size="48FS" quality="Q1" barcode="8901208428561" price=" 895.00"></SUBITEM><SUBITEM size="38FS" quality="Q1" barcode="8901208428578" price=" 895.00"></SUBITEM></ITEM>
    <ITEM>
    <EXTERNALID>ARSH0002</EXTERNALID>
    <DESCRIPTION>BLACK DIAGEO SHIRT</DESCRIPTION>
    <MATYPE>ZFGM</MATYPE>
    <TAXCD>1</TAXCD>
    <BRANDID>AR</BRANDID>
    <UOMID>PC</UOMID>
    <PRODUCTHIERARCHY>METOPSSHFASHN00895</PRODUCTHIERARCHY>
    <MANUFACTURER1>FASHION</MANUFACTURER1>
    <COLOR>BLACK</COLOR>
    <THEME></THEME>
    <COLLECTION>empty</COLLECTION>
    <FIT></FIT>
    <SEASON>S06</SEASON>
    <PRDGRP>SH</PRDGRP>
    <PRDCOLL>TOPS</PRDCOLL>
    <TARGET>ME</TARGET>
    <GRID>GRID01</GRID>
    <SUBITEM size="38FS" quality="Q2" barcode="100051078" price=" 895.00"></SUBITEM>
    <SUBITEM size="38FS" quality="Q3" barcode="100051079" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q2" barcode="100051080" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q3" barcode="100051081" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q2" barcode="100051082" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q3" barcode="100051083" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q2" barcode="100051084" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q3" barcode="100051085" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q2" barcode="100051086" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q3" barcode="100051087" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q2" barcode="100051088" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q3" barcode="100051089" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q2" barcode="100051090" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q3" barcode="100051091" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q1" barcode="8901208428653" price=" 895.00"></SUBITEM><SUBITEM size="40FS" quality="Q1" barcode="8901208428660" price=" 895.00"></SUBITEM><SUBITEM size="42FS" quality="Q1" barcode="8901208428677" price=" 895.00"></SUBITEM><SUBITEM size="44FS" quality="Q1" barcode="8901208428684" price=" 895.00"></SUBITEM><SUBITEM size="46FS" quality="Q1" barcode="8901208428691" price=" 895.00"></SUBITEM><SUBITEM size="48FS" quality="Q1" barcode="8901208428707" price=" 895.00"></SUBITEM><SUBITEM size="38FS" quality="Q1" barcode="8901208428714" price=" 895.00"></SUBITEM></ITEM>
    </ITEMLIST>
    -- Sql
    SELECT extract(value(d), '//EXTERNALID/text()').getStringVal() AS EXTERNALID,
         extract(value(d), '//DESCRIPTION/text()').getStringVal() AS DESCRIPTION,
              extract(value(d), '//MATYPE/text()').getStringVal() AS MATYPE,
              extract(value(d), '//TAXCD/text()').getStringVal() AS TAXCD,
              extract(value(d), '//BRANDID/text()').getStringVal() AS BRANDID,
              extract(value(d), '//UOMID/text()').getStringVal() AS UOMID,
              extract(value(d), '//PRODUCTHIERARCHY/text()').getStringVal() AS PRODUCTHIERARCHY,
              extract(value(d), '//MANUFACTURER1/text()').getStringVal() AS MANUFACTURER1,
              extract(value(d), '//COLOR/text()').getStringVal() AS COLOR,
              extract(value(d), '//THEME /text()').getStringVal() AS THEME ,
              extract(value(d), '//COLLECTION/text()').getStringVal() AS COLLECTION,
              extract(value(d), '//FIT/text()').getStringVal() AS FIT,
              extract(value(d), '//SEASON/text()').getStringVal() AS SEASON,
              extract(value(d), '//PRDGRP/text()').getStringVal() AS PRDGRP,
              extract(value(d), '//PRDCOLL/text()').getStringVal() AS PRDCOLL,
              extract(value(d), '//TARGET/text()').getStringVal() AS TARGET,
              extract(value(d), '//GRID/text()').getStringVal() AS GRID,
              extract(value(z), '//@size').getStringVal() AS size_cd,
              extract(value(z), '//@quality').getStringVal() AS quality,
              extract(value(z), '//@barcode').getStringVal() AS barcode,
              extract(value(z), '//@price').getStringVal() AS price                         
         FROM xml_tab x,
    table(xmlsequence(extract(value(x), '//ITEMLIST/ITEM'))) d,
              table(xmlsequence(extract(value(x), '//ITEM/SUBITEM')))z
    The above sql gives me a cartesian join for all the subitems to the items tag.
    i.e.,
    externalid
    ARSH0001 -- 2 * 12 times for one record.
    Pls give me a solution. I am struggling on this.
    Please.
    Regds,
    Santhoshkumar.G.

  • Merge cartesian join in query plan

    Hi All
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    W are using many GTT's in our code, the query plan have Merge Cartesain join showing cardinality as '1' which is incorrect, as GTT tables have many rows. Due to this query is taking ages to execute.
    I am trying to sue dynamic sampling, but it doesn't seem to work.
    please help on this.

    user8650395 wrote:
    Hi All
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    W are using many GTT's in our code, the query plan have Merge Cartesain join showing cardinality as '1' which is incorrect, as GTT tables have many rows. Due to this query is taking ages to execute.
    I am trying to sue dynamic sampling, but it doesn't seem to work.
    please help on this.Interesting.
    There was a a thread a day or two ago about when dynamic sampling does not work. You can search OTN for it if you like. Also check the docs to make sure that dynamic sampling works with GTTS
    One problem with GTTS is getting accurate statistics. Have you considered using DBMS_STATISTICS to set the statistics on the table to adjust the cardinality?
    Your cardinality of 1 sounds incorrect. In theory a cartesian join against one row should be painelss; unfortunately your cardinality figure seems to be off! Sometimes in cases like yours the cost-based optimizer will choose a Cartesian join even when the table joins are properly specified.

  • Pls help me any one, ADF Faces EO,VO creation in mutiple table..

    problem here:
    table1
    field1 (pk)
    field2 NAME
    table2
    field1 (pk)
    field2 (fk for table1)
    field3 NAME
    table3
    field1 (pk)
    field2 (fk for table2)
    field3 NAME
    Here each table having separate panel tabbed, i want to show table1 of
    field2 in third panel tabbed(screen). How i can create EO,VO to show
    with success.
    When i'm showing the table1 of field2, is not require to do a DML operations.
    like this my third screen's adf table
    field2(table1) field2(table3) field3(table3)
    (showing for
    user identify)
    Urgent Requirement pls help me.
    In case of any query please free to mail @ [email protected]
    Thanks & Regards,
    Rengaraj
    Edited by: user11129216 on May 4, 2009 7:21 AM

    Like Frank, I'm not 100% sure I'm understanding your requirement, but here are some observations.
    Your three tables look like master/detail/detail, let's say it was Regions->Countries->Locations
    So, you would build a RegionsView VO to show the Regions information.
    You would build a CountriesView VO to show the Countries information.
    You would build a LocationsView VO to show the Locations information.
    Then you would create a view link between RegionsView and CountriesView to coordinate that master/detail relationship.
    Then you would create a view link between CountriesView and LocationsView to coordinate that master/detail relationship.
    All of the above will be created automatically for you if you have foreign keys defined in the database when you use the Create Business Components from Tables wizard. (including the underlying entity objects for your database tables, associations that reflect your foreign key relationships).
    If you want LocationsView to show information from its parent, you can include the Country EO as an entity usage in the LocationsView and include the attributes from country that you want to appear in that (join) query. You can repeat to also add the Region EO as an entity usage to join all three.
    Then, you would drop RegionsView from the data control palette onto tab1, CountriesView onto tab2, and LocationsView onto tab 3.

  • Pls help me in creating a view

    Hi All,
    We have few tables in Oracle HRMS, per_jobs table gives the details of the all jobs defined,
    PAY_JOB_WC_CODE_USAGES table contains the all the compensation codes defined and PAY_STATE_RULES
    table contains the all the state codes.
    Now, SELECT WC.STATE_CODE,
    PJ.JOB_ID,
    PSR.NAME STATE_NAME,
    PJ.NAME JOB_NAME
    FROM per_jobs pj,
    PAY_JOB_WC_CODE_USAGES WC,
    PAY_STATE_RULES PSR
    WHERE PJ.JOB_ID(+) = WC.JOB_ID
    AND WC.STATE_CODE(+) = PSR.STATE_CODE
    This Query gives the job_names which are defined in a state..
    But, Now what I want is
    I want to get the Job Names which are not defined in each state for that I want to create a view
    So, Could u pls help me in writing this Query.
    Example,
    SELECT * FROM PER_JOBS
    where job_id not in (select job_id from PAY_JOB_WC_CODE_USAGES where STATE_CODE = 'VA')
    This will give the job details which are not defined in the State called "VA"..
    But, I want all the Jobs which are not defined in all the states..
    Thanks

    Hi,
    I think you want something like this:
    SELECT  pj.*
    ,     psr.state_code
    FROM     per_jobs     pj
    JOIN     pay_state_rules     psr  ON  NOT EXISTS (
                                               SELECT  0
                                  FROM     pay_job_wbc_code_usages
                                  WHERE     job_id         = pj.job_id
                                  AND     state_code  = psr.state_code
    ;Say there are 50 states, and a given job occurs in 48 of them, this query will show that job 2 times, paired once with each of the 2 states where it does not occur.
    Instead of an EXISTS sub-query, you could use an IN sub-query.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data. Simplify the data. For example, pretend (for posting only) that you only have 3 or 4 states.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • Pls help my bb 9380 is showing initialization failed ,when looking for network

    pls i use a bb 9380 curve 5,just recently my fone trips off and on,but still works perfectly fine,but yesterday it refuses to
    to load my sim,i just shows initilization failed with an S0S service,i was told by the technicians here,that its only RIM that can rectify it for me,pls help.

    Hi and Welcome to the Community!
    Well, sadly, those technicians may have misdirected you. This site is a user-to-user community of volunteers...it is not a channel for any formal communications with, support from, nor escalation to RIM. RIM provides zero front-line support to any end-users...such is actually contractually prohibited.
    The technicians, if they are authorized BB support folks, have channels for escalating things to RIM that need to be so. I recommend you go back to them and have them do so.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Logic needed - pls help me urgent

    Hi
    p_werks , p_vstel, s_vbeln are my selection screen.
    I want to extract following fields into one internal table.
    How to extract the fields using inner join or outer join?
    LIKP  ---  vkorg,vstel, kunag, lfdat,wadat,lifnr
    LIPS  ---  vbeln,posnr,werks,matnr,lfimg,meins,
    VBKD ---  bstkd, posex_e  (vbkd -vbeln = lips-vgbel)
    sydatum, ernam,rundate, runtime.
    Pls help me

    hi,
    Select vkorg vstel  kunag lfdat wadat lifnr from likp into table t_likp where
    Vbeln = p_vbeln and werks = p_werks.
    If not t_likp [] is initial.
    Select vbeln posnr werks matnr lfimg meins into table t_lips fronm lips  for all entries in table t_likp where vbeln = t_likp-vbeln.
    Endif.
    If not t_lips [] not initial.
    Select bstkd  posex_e into table t_vbkd from vbkd for all entries in t_lips where vgbel = t_lips-vbeln.
    Endif.
    check with this code.
    Regards,
    Narasimha
    Edited by: narasimha marella on Jun 11, 2008 6:14 AM
    Edited by: narasimha marella on Jun 11, 2008 6:18 AM

  • Need help in join

    hi,
    Following are my columns data in same table,
    Value1 Value2
    1 1
    2 2
    3 4
    1 3
    My output sould be as like follows
    value
    1
    2
    3
    4
    so please help me on this logc by proving sample query

    Hey or in other way i will explain my requirment,
    i have two reslutset,
    result set A and result set b. i want to join both the result set and bring the output as follows.
    resultA
    1
    2
    3
    1
    resultB
    1
    2
    3
    4
    ned to join these two results and bring the out put as follows
    result:
    1
    2
    3
    4
    i given my requirement in last post bit wrongly, the above requirement is correct. can u pls help me now

  • Cartesian Joins Problem

    I am creating a view, but the explain plan is telling me that I have a cartesian join. I can not seem to identify it. Can some help me here please. Here is the SQL:
    CREATE OR REPLACE VIEW VW_SERVICE_HEADER
    SERVICE_ID,
    JON,
    SERVICE_ACTION,
    PROGRAM
    AS
    SELECT SH.SERVICE_ID,
         SH.JON.JULIAN||
    SH.JON.SHOP_CODE||
    SH.JON.ORG_CODE||
    SH.JON.JON_SEQUENCE JON,
         SH.JON_ACTION SERVICE_ACTION,
    P.PROGRAM_NAME
    FROM ITM.TB_ITEM_MASTER IM, FLD.TB_SERVICE_DETAIL SD,
    FLD.TB_SERVICE_HEADER SH, LKP.TB_STAGE S, LKP.TB_PROGRAM P,
    TABLE(IM.PROGRAMS) IMP
    WHERE
    S.STAGE_ID (+) = SH.STAGE_ID AND
    IM.ITEM_NO_ID (+) = SH.COMPONENT_REPAIR_ID AND
    SH.SERVICE_ID = SD.SERVICE_ID (+) AND
    P.PROGRAM_ID (+) = IMP.PROGRAM_ID AND
    (P.PROGRAM_ID = SYS_CONTEXT('CTX_DMIS_PROGRAMS','PROGRAM_ID') OR SYS_CONTEXT('CTX_DMIS_PROGRAMS', 'PROGRAM_ID') IS NULL)
    ORDER BY SH.SERVICE_ID DESC
    /

    how about this. Will this work???
    CREATE OR REPLACE VIEW DMIS_DATA.VW_SERVICE_HEADER_TEST
    SERVICE_ID,
    JON,
    SERVICE_ACTION,
    ORGANIZATION_NAME,
    PROGRAM
    AS
    SELECT SH.SERVICE_ID,
         SH.JON.JULIAN||
    SH.JON.SHOP_CODE||
    SH.JON.ORG_CODE||
    SH.JON.JON_SEQUENCE JON,
         SH.JON_ACTION SERVICE_ACTION,
         O.ORGANIZATION_NAME,
    P.PROGRAM_NAME
    FROM ITM.TB_ITEM_MASTER IM,
    FLD.TB_SERVICE_DETAIL SD,
    FLD.TB_SERVICE_HEADER SH,
    LKP.TB_STAGE S,
    LKP.TB_PROGRAM P,
    FLD.TB_ORGANIZATION O,
    TABLE(IM.PROGRAMS) IMP
    WHERE
    S.STAGE_ID (+) = SH.STAGE_ID AND
    IM.ITEM_NO_ID (+) = SH.COMPONENT_REPAIR_ID AND
    SH.SERVICE_ID = SD.SERVICE_ID (+) AND
    P.PROGRAM_ID (+) = IMP.PROGRAM_ID AND
    O.ORG_ID(+) = SH.JON.ORG_CODE AND
    (P.PROGRAM_ID = SYS_CONTEXT('CTX_DMIS_PROGRAMS','PROGRAM_ID')
    OR SYS_CONTEXT('CTX_DMIS_PROGRAMS', 'PROGRAM_ID') IS NULL)
    ORDER BY SH.SERVICE_ID DESC
    I added another table O that could help link IMP and P to the rest

  • QUERY CLARIFICATION RQD :  gurus, experts pls help

    Hai,
    I am facing problem in performance of the query. sample scenario i have created here pls help me to solve
    **VEH_MAIN* TABLE (MASTER TABLE)*
    CREATE TABLE VEH_MAIN
       (     VIP_MOT_IND VARCHAR2(10 BYTE),
         VIP_IND NUMBER(10,0)
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',1);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT02',5);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('M0T03',1);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',2);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT02',6);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',3);
    Insert into VEH_MAIN (VIP_MOT_IND,VIP_IND) values ('MOT01',4);
    **VEH_ENGINE_SUB* (table for engine subclass)*
      CREATE TABLE VEH_ENG_SUB
       (     ENG_SUBCLASS VARCHAR2(50 BYTE),
         ENG_MOT_IND VARCHAR2(10 BYTE)
    Insert into VEH_ENG_SUB (ENG_SUBCLASS,ENG_MOT_IND) values ('ENGSUB001','MOT01');
    Insert into VEH_ENG_SUB (ENG_SUBCLASS,ENG_MOT_IND) values ('ENGSUB001','MOT02');
    *VEH_ENG_IND( Detail table for engine subclass)*
      CREATE TABLE VEH_ENG_IND
       (     "ENG_SUBCLASS" VARCHAR2(50 BYTE),
         "ENG_IND" VARCHAR2(10 BYTE)
    Insert into VEH_ENG_IND (ENG_SUBCLASS,ENG_IND) values ('ENGSUB001','1');
    Insert into VEH_ENG_IND (ENG_SUBCLASS,ENG_IND) values ('ENGSUB001','2');
    *VEH_AXIS( Master table for Engine Axis)*
    CREATE TABLE VEH_AXIS
       (     ENG_AXIS VARCHAR2(50 BYTE),
         AXIS_MOT_IND VARCHAR2(10 BYTE)
    Insert into VEH_AXIS (ENG_AXIS,AXIS_MOT_IND) values ('ENGAXIS001','MOT01');
    Insert into VEH_AXIS (ENG_AXIS,AXIS_MOT_IND) values ('ENGAXIS002','MOT02');
    *VEH_AXIS_IND( Details table for engine axis)*
    CREATE TABLE VEH_AXIS_IND
       (     ENG_AXIS VARCHAR2(50 BYTE),
         ENG_IND VARCHAR2(10 BYTE)
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','1');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','2');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','3');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS001','4');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS002','5');
    Insert into VEH_AXIS_IND (ENG_AXIS,ENG_IND) values ('ENGAXIS002','6');
    Condition 1
    if i select only ENGINE_SUBCLASS='ENGSUB001' then
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )output is
    MOT01     1
    MOT01     2
    Condition 2:if i select only the Engine Axis='ENGAXIS002' then the
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE  v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002';MOT02     5
    MOT02     6
    Condition 3:
    BOTH ENGINE AXIS AND ENGINE SUBCLASS
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    AND  ( v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002');Null values returned. this is correct.
    But the query PERFORMANCE fails in OR CONDITON as below
    Condition 4;
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    OR  ( v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002');output
    MOT02     5
    MOT02     5
    MOT02     5
    MOT02     5
    MOT02     6
    MOT02     6
    MOT02     6
    MOT02     6
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     1
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    MOT01     2
    This is sample example. when i implement in huge table with partition this scennario takes much time even 2 hours to run.
    i want the output must be as below if i use OR condition like condition 4
    MOT01     1
    MOT01     2
    MOT02     5
    MOT02     6
    Gurus and experts pls help me to solve this problem. Dont give any suggestion like
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_axis  vaxis,
    veh_axis_ind vaind
    WHERE  v.vip_mot_ind= vaxis.axis_mot_ind
    and   v.vip_ind= vaind.eng_ind
    and   vaind.eng_axis= vaxis.eng_axis
    and   vaxis.eng_axis='ENGAXIS002'
    union
    SELECT  vip_mot_ind,vip_ind
    FROM veh_main V,
    veh_eng_sub vsub,
    veh_eng_ind  vind
    WHERE (v.vip_mot_ind= vsub.eng_mot_ind
    and   v.vip_ind=vind.eng_ind
    and    vsub.eng_subclass= vind.eng_subclass
    AND vsub.eng_subclass='ENGSUB001' )
    }this will give correct result...
    MOT01     1
    MOT01     2
    MOT02     5
    MOT02     6
    but the problem is we cannot implement this in query. because query get framed at runtime there will be so many implement has to be done. other than UNION pls give me more suggesion
    waiting..
    S
    Edited by: A Beginner on Sep 11, 2010 12:51 AM

    create a view v1 with all the joins
    select * from v1 where eng_subclass='ENGSUB001'
    union
    select * from v1 where eng_axis='ENGAXIS002'
    If you really do not like the direct access with union, try this
    select * from v1
    where vsub_PK in (select vsub_PK from v1 where eng_subclass='ENGSUB001' )
    OR vsub_PK in (select vsub_PK from v1 where eng_axis='ENGAXIS002')
    --vsub_PK is the primary key of table vsub                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Pls pls pls help :(

    ok im a minor 12 yrs old i created a apple id for the first time on my iphone 4 ios 5.1.1 it asked me to verify the id i wen there but it asked for A PAYMENT option i hv no credit card obviously but it dosent allow me to verify mi id now (us app store) pls pls help thanks in advance

    Please try this first off:
    Go to Options > Device > Advanced > Applications and scroll the AppWorld application and don't click on it, just scroll to it. Click Menu > Delete and remove the application.
    Now, do a reboot: With the BlackBerry device powered ON, remove the battery a few seconds and then reinsert the battery to reboot.
    Finally, use your BlackBerry browser to go to http://blackberry.com/appworld and download/install the AppWorld application again.
    After installation and possibly another reboot, check your Applications folder, or Downloads folder for the application. It will likely be located in the same spot as before you upgraded.
    That should update your BBID as well.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for