Query report issue with Joins

HI Everyone,
I'm facing a issue with SQ02, where I need to link 2 table COVP and AFRU . Now that I have 2 feilds in COVP REFBN and AWORG which is or Char(10) feilds and I need to link this with tabl;e AFRU feilds RUECK and RMZHL which is of Num(10) and Num(4).
I cant use a join link between these 2 feilds as it says illegal join. Now I need to pull data by the input from COVP that of refbn and aworg.
Please let me know how to go about and implement this? Is there a way where I can use the code section and write code for this. I need to further add another table CATSDB from the output from AFRU.
Thanks & Best regards,
Raj

Hi Raj,
I had the same problem with other join, since the two fields are different it is not possible to use a join on them.
The only solution that occurred to me was to create an auxiliary table to map both fields with all possible values, like this:
| fild1 | field2  |
|   001   | 00001 |
|   002   | 00002 |
And a view with one of the tables together with this auxiliary one. Then the join would use this view...
I admit it isn't pretty, but it would work. However in the end I've decided to write a program instead of using a query to obtain our client's desired map.
best regards,
Edgar

Similar Messages

  • Issue with Join query

    Question 1:
    I have run into an issue of join between the two tables.
    There are two tables named a and b with the following descriptions -
    desc a
    Name Null Type
    STORE_NUMBER NOT NULL CHAR(9)
    ASSORTMENT_NUMBER NOT NULL CHAR(9)
    ITEM_NUMBER NOT NULL CHAR(9)
    DESCRIPTION CHAR(1000)
    UPC_CODE NOT NULL CHAR(15)
    STOCK_FLAG CHAR(1)
    AVG_RTL_PRICE CHAR(16)
    SALES_MOVEMENT CHAR(16)
    PROD_STYLE CHAR(50)
    COLOR CHAR(50)
    ATT_1 CHAR(50)
    ATT_2 CHAR(50)
    ATT_3 CHAR(50)
    ATT_4 CHAR(50)
    ATT_5 CHAR(50)
    ATT_6 CHAR(50)
    ATT_7 CHAR(50)
    ATT_8 CHAR(50)
    ATT_9 CHAR(50)
    ATT_10 CHAR(50)
    ATT_11 CHAR(50)
    ATT_12 CHAR(50)
    ATT_13 CHAR(50)
    ATT_14 CHAR(50)
    ATT_15 CHAR(50)
    25 rows selected
    desc b
    Name Null Type
    ASSORTMENT_NUMBER NOT NULL CHAR(9)
    ITEM_NUMBER NOT NULL CHAR(9)
    MERCH_METHOD NOT NULL VARCHAR2(15)
    UPC_CODE NOT NULL CHAR(15)
    MODEL_NUMBER CHAR(50)
    HEIGHT CHAR(10)
    WIDTH CHAR(10)
    DEPTH CHAR(10)
    IMAGE_FILE_NAME CHAR(500)
    LINESHAPE_FILE_NAME CHAR(500)
    IPU CHAR(10)
    ASSORTMENT_NAME VARCHAR2(100)
    12 rows selected
    There are 23094 records for assortment_number 16370 in the table a and 123 records in the table b.
    But, when I run the below query using matching assortment number and upc code, its returning more than 2.5 million records. Why is it doing a product?
    select
    a.store_number,
    a.assortment_number,
    a.item_number,
    a.description,
    a.upc_code,
    a.avg_rtl_price,
    a.sales_movement,
    b.height,
    b.width,
    b.depth,
    b.merch_method,
    b.model_number,
    b.ipu,
    b.assortment_name
    from a,
    b
    where
    ltrim(trim(a.assortment_number),0) = ltrim(trim(b.assortment_number),0)
    and ltrim(trim(a.assortment_number),0) = ‘16370’
    and
    ltrim(trim(b.upc_code),0) = ltrim(trim(b.upc_code),0);
    Question 2 -
    Can I break the query down by store numbers from both the tables and extract them to separate files by store numbers?
    Appreciate your inputs. Thanks in advance.

    853720 wrote:
    But how do I fix my query so as to return not the product of the two tables but only the unique matching records based on assortment_number and upc_code ?And what is "unique matching record" Based on table B each assortment has multiple items. So it looks like table B uniqueness is on assortment_number, item_number. So question is what is column upc_code? Is it assortment upc or item upc? If it is not item upc - you got your unswer. Actually, I just noticed:
    ltrim(trim(<font size=4 color=red>b</font>.upc_code),0) = ltrim(trim(<font size=4 color=red>b</font>.upc_code),0);It should be:
    ltrim(trim(<font size=4 color=red>a</font>.upc_code),0) = ltrim(trim(<font size=4 color=red>b</font>.upc_code),0);SY.
    P.S. I am not questioning column datatypes at this point, but they obviously indicate bad design. You should at least use VARCHAR2 instead of CHAR.

  • Issue with Join in query?

    Hi All,
    I have a query report for sales which is giving multiple data if the invoice is based on multiple sales order i.e 2 SO copied to 1 delivery and 1 delivery copied to single invoice.
    SELECT DISTINCT concat(T13.BeginStr,right(T7.DOCNUM,6)) AS ' INVOICE No.',T7.DocDate as 'Invoice Date',T7.DocDueDate,
    T1.DocNum ,T1.DocDate'DocDate',T7.CardCode as 'Customer Code',  T7.CARDNAME as 'Customer Name',T7.U_otherref
    ,T3.DocNum As ' DC Ref#',
    T3.DocDate as 'DC Date',
    T7.SHIPTOCODE as 'Ship To Code',T6.Linenum,T6.ITEMCODE,T6.DSCRIPTION,T6.U_SaleType,T6.U_SpclDeal, cast(T15.UserText as VarChar) as 'Item Remarks',
    T6.QUANTITY,T6.WhsCode as 'Wh Name',T6.UnitMsr as 'UoM',T6.PriceBefDi as 'Basic Price',
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )VAT,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=7 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )Surcharge,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=18 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )AddVat,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )EntryTax,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=4 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )CST,
    T7.NUMATCARD as 'Customer PO No.'
    FROM        
                         dbo.RDR1 T0 left  JOIN
                          dbo.ORDR T1 ON T1.DocEntry = T0.DocEntry  LEFT JOIN
                          dbo.DLN1 T2 ON T2.BaseEntry = T1.DocEntry LEFT JOIN
                          dbo.ODLN T3 ON T2.DocEntry = T3.DocEntry  left JOIN
                          dbo.INV1 T6 ON T6.BaseEntry = T3.DocEntry LEFT outer JOIN
                          dbo.OINV T7 ON T7.DocEntry = T6.DocEntry  LEFT JOIN
                          dbo.OITM T15 ON T15.ItemCode = T6.ItemCode  LEFT JOIN
                          dbo.OSLP T8 on T1.SLPCode = T8.SlpCode    LEFT JOIN
                          dbo.OHEM T9 on T1.OwnerCode = T9.empID    LEFT JOIN
                          dbo.INV12 T10 on T7.Docentry = T10.DocEntry LEFT JOIN
       dbo.OCRD T12 on T7.CardCode = T12.CardCode LEFT JOIN
       NNM1 T13 ON T7.Series = T13.Series left join
       OITB T14 on T14.ItmsGrpCod = T15.ItmsGrpCod
    WHERE T6.BaseType = '15'  and T7.Doctype = 'I' --and T7.docnum = '46000138'
    Can someone please let me know which join is wrong here that its fetching multiple lines?
    Thanks,
    Joseph

    Hi Joseph,
    Try this query without UDF:
    SELECT DISTINCT T7.DOCNUM AS ' INVOICE No.',T7.DocDate as 'Invoice Date',T7.DocDueDate,
    T1.DocNum ,T1.DocDate'DocDate',T7.CardCode as 'Customer Code',  T7.CARDNAME as 'Customer Name'
    ,T3.DocNum As ' DC Ref#',
    T3.DocDate as 'DC Date',
    T7.SHIPTOCODE as 'Ship To Code',T6.Linenum,T6.ITEMCODE,T6.DSCRIPTION, cast(T15.UserText as VarChar) as 'Item Remarks',
    T6.QUANTITY,T6.WhsCode as 'Wh Name',T6.UnitMsr as 'UoM',T6.PriceBefDi as 'Basic Price',
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )VAT,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=7 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )Surcharge,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=18 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )AddVat,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )EntryTax,
    (Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=4 and INV4.docentry=T7.Docentry and INV4.linenum = T6.Linenum )CST,
    T7.NUMATCARD as 'Customer PO No.'
    FROM        
                         dbo.RDR1 T0 left  JOIN
                          dbo.ORDR T1 ON T1.DocEntry = T0.DocEntry  LEFT JOIN
                          dbo.DLN1 T2 ON T2.BaseEntry = T1.DocEntry and T2.[BaseLine] = T0.[LineNum] LEFT JOIN
                          dbo.ODLN T3 ON T2.DocEntry = T3.DocEntry  left JOIN
                          dbo.INV1 T6 ON T6.BaseEntry = T3.DocEntry and T6.[BaseLine] = T2.[LineNum]LEFT outer JOIN
                          dbo.OINV T7 ON T7.DocEntry = T6.DocEntry  LEFT JOIN
                          dbo.OITM T15 ON T15.ItemCode = T6.ItemCode  LEFT JOIN
                          dbo.OSLP T8 on T1.SLPCode = T8.SlpCode    LEFT JOIN
                          dbo.OHEM T9 on T1.OwnerCode = T9.empID    LEFT JOIN
                          dbo.INV12 T10 on T7.Docentry = T10.DocEntry LEFT JOIN
       dbo.OCRD T12 on T7.CardCode = T12.CardCode LEFT JOIN
       NNM1 T13 ON T7.Series = T13.Series left join
       OITB T14 on T14.ItmsGrpCod = T15.ItmsGrpCod
    WHERE T6.BaseType = '15'  and T7.Doctype = 'I' and T7.docnum = [%0]
    Thanks & Regards,
    Nagarajan

  • SAP Query format issue (with ABAP list)

    Hi All,
    I had a requirement to remove all unecessary formatting and text from a SAP query report which can be read by a third party software system. We need only Header line and  report data (spaced by Tab).
    I have removed all formatting from the report and changed the output format from "SAP list viewer" to "ABAP list" .
    The issue is that the report shows material number with 12 digits in output but when we download to file then it adds extra six "0" and makes the Material Number field as 18 digit.
    we have already maintained new length as 12 againts the standard length 18 for material number(under field output option)
    Please suggest how to get rid of extra digits generated during downloading.
    Please help,
    Thanks,
    Rohit

    Hi Brad,
    Currently we execute query with SQ01 and from the output screen the user direclty saves the file as "local file..."
    The output format is "abap list". We are able to get the exact format but the only problem is with material number. I cant make changes in the program. Is there a way to download it without changing the 12 character ( as displayed on the report output)
    Thanks for help.
    Rohit

  • BW 3.5, BEx Query designer issue with text of the characteristics

    Hi All,
    We are currently using BEx 3.5 Query Designer to design the queries. We have one of the ODS on which we are querying for.
    We have 3 different types of Customer in this ODS. 0Customer, 0BBP_CUSTOMER and 0GN_CUSTOMER. The problem is when we open this ODS in Query designer we see their text name on the left hand side column where it shows data fields as the same text name Customer.
    Now the our Power users have raised the issue that it is very confusing even when there are 3 different technical names for these characteristics.
    2 Questions I have.
    1) Why is something like this happening? is it some issue with the Patch or something. We will be migrating to new BI soon but in the mean time if I could resolve it that will be the best. Or does it even get resolved with new BI???
    2) what is the way in which we can resolve it?
    Thanks in advance and points will be given generously.

    HI BI Consul!
    Things like this happen, when it is called customer it could be different customers, 0customer is the standard R/3 customer and 0BBP_customer is objects from CRM and most likely 0GN_Customer might be customer from different system.
    Sure, power users should be told which customer is customer and you could also change the discription of the object, to match the definition on the other system. You could also just create z object and replace the existing confusing object with something meaningful to users.
    thanks.
    Wond

  • 10g Reports issue with XML Data Source

    Hi,
    Has anybody ever encountered an issue with Oracle 10g report using an XML as the data source? What happens is, some of the values in the XML are printed to the wrong column.
    One of the elements in our XML file is a complex type with 10 elements under it. The first 5 are picked up properly, but the last 6 are not. Elements #6 to #9 has a minimum occurence of 0. What happens is when element #6 is present, but #7 is, the value for element #7 is passed on to element #6.
    The XSD and XSL files are both valid since the reports were working when we were still using 9i. There is no hidden logic in the report which might cause this issue to come up, i.e., the report just picks up the values from the XML and prints it to the appropriate columns.
    Any help will be greatly appreciated.

    XSD used
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <!-- trade instructions detail & trailer -->
            <xs:element name="TradeDetail">
                    <xs:complexType>
                            <xs:sequence>
                                    <xs:element ref="TradeType"/>
                                    <xs:element ref="TradeID"/>
                                    <xs:element ref="TradeDate"/>
                                    <xs:element ref="FundID"/>
                                    <xs:element ref="FundName"/>
                                    <xs:element ref="DollarValue" minOccurs="0"/>
                                    <xs:element ref="UnitValue" minOccurs="0"/>
                                    <xs:element ref="PercentageValue" minOccurs="0"/>
                                    <xs:element ref="OriginalTradeID" minOccurs="0"/>
                                    <xs:element ref="CancellationFlag"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <xs:element name="Instruction">
                    <xs:complexType>
                            <xs:sequence minOccurs="0">
                                    <xs:element ref="TradeDetail" maxOccurs="unbounded"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <!-- overall trade instruction message -->
            <xs:element name="InterchangeHeader">
                    <xs:complexType>
                            <xs:sequence>
                                    <xs:element ref="Instruction"/>
                            </xs:sequence>
                    </xs:complexType>
            </xs:element>
            <!-- definition of simple elements -->
            <xs:element name="FundID" type="xs:string"/>
            <xs:element name="TradeType" type="xs:string"/>
            <xs:element name="TradeID" type="xs:string"/>
            <xs:element name="TradeDate" type="xs:string"/>
            <xs:element name="FundName" type="xs:string"/>
            <xs:element name="DollarValue" type="xs:decimal"/>
            <xs:element name="UnitValue" type="xs:decimal"/>
            <xs:element name="PercentageValue" type="xs:decimal"/>
            <xs:element name="OriginalTradeID" type="xs:string"/>
            <xs:element name="CancellationFlag" type="xs:string"/>
    </xs:schema>
    XML used
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <InterchangeHeader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TradeInstruction.xsd">
       <Instruction>
          <TradeDetail>
             <TradeType>Purchase</TradeType>
             <TradeID>M000038290</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>ARO0011AU</FundID>
             <FundName>ABN Fund</FundName>
             <DollarValue>2111.53</DollarValue>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
          <TradeDetail>
             <TradeType>Redemption</TradeType>
             <TradeID>M000038292</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>ARO0011AU</FundID>
             <FundName>AMRO Equity Fund</FundName>
             <UnitValue>104881.270200</UnitValue>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
          <TradeDetail>
             <TradeType>ISPurchase</TradeType>
             <TradeID>M000038312</TradeID>
             <TradeDate>20061201</TradeDate>
             <FundID>MLC0011AU</FundID>
             <FundName>Cash Fund</FundName>
             <OriginalTradeID>M000038311</OriginalTradeID>
             <CancellationFlag>N</CancellationFlag>
          </TradeDetail>
       </Instruction>
    </InterchangeHeader>
    XSLT used
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
            <xsl:template match="/">
                    <InterchangeHeader>
                            <xsl:for-each select="InterchangeHeader/Instruction/TradeDetail">
                            <xsl:sort select="FundName"/>
                            <xsl:sort select="TradeDate"/>
                                    <TradeDetail>
                                            <TradeType><xsl:value-of select="TradeType"/></TradeType>
                                            <TradeID><xsl:value-of select="TradeID"/></TradeID>
                                            <TradeDate><xsl:value-of select="TradeDate"/></TradeDate>
                                            <FundID><xsl:value-of select="FundID"/></FundID>
                                            <FundName><xsl:value-of select="FundName"/></FundName>
                                            <DollarValue><xsl:value-of select="DollarValue"/></DollarValue>
                                            <UnitValue><xsl:value-of select="UnitValue"/></UnitValue>
                                            <PercentageValue><xsl:value-of select="PercentageValue"/></PercentageValue>
                                            <OriginalTradeID><xsl:value-of select="OriginalTradeID"/></OriginalTradeID>
                                            <CancellationFlag><xsl:value-of select="CancellationFlag"/></CancellationFlag>
                                    </TradeDetail>
                            </xsl:for-each>
                    </InterchangeHeader>
            </xsl:template>
    </xsl:stylesheet>

  • Using "Restrict by app" in change query causes issues with Search Results

    Hello!
    I am hoping some experienced SP admin can help me out. I am having issues with the relevance ranking for my search results web part.
    I created a Wiki (OOTB) within a site collection and on the home page of the Wiki I was looking to apply a Search Box and Search Results web part for easy searching. I wanted to ensure the search results were restricted to the scope of the pages within the
    wiki. I did the following after adding the 2 web parts:
    Entered edit mode for the page
    Started to edit the Search Results web part
    Under Properties for Search Results clicked on "Change Query"
    Navigated to BASICS and clicked "Switch to Quick Mode"
    For Select Query, picked "Wiki (System)" option
    For Restrict by app, picked "Specify a URL" and input the wiki URL "http://webapp.com/sites/sitecollection/wiki"
    Click OK
    The web part has 6 automatic results when I hit the page. These are the only 6 pages in my wiki. When I search a word or title of a page, they are not ranked in order or relevance. The ordering is static to what was being shown before the search, but the
    keywords I'm searching are bold. With out the taking the steps above, I can easily search these pages and have them ranked appropriately so I'm not too sure what I'm doing wrong. 
    Other Details
    The pages have been crawled and can be searched from anywhere else in SP.
    I am only a site collection admin for this specific site collection.
    I other than the steps above, I have not made any changes or customization to the search web parts; they are both out of the box SP.
    The SP Farm admin we unable to pin point what the root cause is either.

    Hi Mikael,
    Sorry for the wait, I was unable to post pictures, which i felt would better describe my issue.
    Could you output the query template you are ending up with?
    If you can tell me how to accomplish this, then I can provide it. Please keep in mind that I am only a site collection admin.
    Also, is the ranking/sorting for your webpart set to ranking?
    When looking at the web part settings, I didn't see an option to modify the ranking. Unfortunately, some sites in my intranet are down now so I can't even double check. Once it's back up, I will verify this as well.
    And how do you know they are ranked incorrectly?
    I wanted to display an image showing what I meant by this. As the wiki is down, I'll do my best with words. When I visit the wiki home page, I already have the search and search results web parts there. Without searching anything, the search results
    web part displays 6 pages that are available in the wiki. When I search, I expect to see the most relevant result at the top. similar to the following: 
    *Search result from another section of the intranet site.*
    What I receive instead is the same list of wiki pages, in the same order. The most relevant result
    is not moved to the top like in the image above, but I can see that the word "rush" is highlighted in bold. I hope this helps.
    If you need more of a description, please let me know.
    Thank you

  • Issue with Joins in Complex Folder

    Hi,
    We have two problems when we include items into complex folders.
    1.
    Say, I have a folder FOLDER1 with joins to FOLDER2 and FOLDER3.
    Create a complex folder with items from folder2 and folder3.
    Include items fro folder1 - Now starts the problem. Discoverer is using join between folder1->folder2 to resolve the items in the complex folder. but i want it to use folder1->folder3. How can make sure it uses the other join?
    2.
    There are some folders included in the complex folder as components but we are not using any items from them anymore. How do I get rid of those components ? They are causing problems because of the joins between them and the real folders I want to use in the complex folder.

    Hi,
    If you have 2 base folders A and B, and you create a join between A and B then both folders will contain the A<->B join.
    If you then create a complex folder X and drag items from A into X. X will not contain the A<->B join. If you want to join X to B in your report then you will have to create a X<-> B join.
    However, if you drag items from both A and B into X, then folder X will implicitly contain the A<->B join. It won't show up in the folder items, but will be shown in the folder dependencies.
    Hope that helps,
    Rod West

  • HT1933 Following the instructions above, I'm constantly redirected to this help page rather than receiving any drop down list to select what my problem is. Are there any other ways to report issues with purchases?

    Following the instructions for reporting an issue with a purchase problem, when selecting "report a probelm", I am not provided with a drop down list, I am redirected to the help page instead.
    Is there any other way to report an issue where the app owner has taken the funds twice for the same product at literally the same time?

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Query caching issue with Toplink version 10.1.3.5.0

    We are in the process of upgrading the toplink version from 9.0.4.7 to 10.1.3.5.0
    We are finding an odd issue with insert statements generated for an aggregate collection mapping with addTargetForeignKeyFieldName.
    We have a Table Ticket and Table Task with Table Activity as a child for both.
    Table Ticket
    Ticket_Key (PK)
    Table B
    Task_Key (PK)
    Table C
    Activity_Key (PK)
    Task_Key (FK)
    Ticket_Key(FK)
    Notes
    Version
    Here are the mappings from
    Ticket Project
    AggregateCollectionMapping activitiesMapping = new AggregateCollectionMapping();
            activitiesMapping.setAttributeName("activities");
            activitiesMapping.setReferenceClass(com.common.Activity.class);
            activitiesMapping.dontUseIndirection();
    activitiesMapping.privateOwnedRelationship();
            activitiesMapping.useCollectionClass(java.util.ArrayList.class);
            activitiesMapping.addTargetForeignKeyFieldName("ACTIVITY.TICKET_KEY", "TICKET.TICKET_KEY");
    activitiesMapping.useBatchReading();
            descriptor.addMapping(activitiesMapping);
    Task Project:
    AggregateCollectionMapping activitiesMapping = new AggregateCollectionMapping();
            activitiesMapping.setAttributeName("activities");
            activitiesMapping.setReferenceClass(com.common.Activity.class);
            activitiesMapping.dontUseIndirection();
    activitiesMapping.privateOwnedRelationship();
            activitiesMapping.useCollectionClass(java.util.ArrayList.class);
            activitiesMapping.addTargetForeignKeyFieldName("ACTIVITY.TASK_KEY", "TASK.TASK_KEY");
    activitiesMapping.useBatchReading();
            descriptor.addMapping(activitiesMapping);
    The tickets and tasks with activities gets inserted in the same transaction.
    Here are the queries that what we get from the toplink version 9.x
    2013-10-29 10:30:50,582  - SELECT SEQ_ACTIVITY.NEXTVAL FROM DUAL
    2013-10-29 10:30:50,582  - INSERT  INTO ACTIVITY (TASK_KEY, VERSION, NOTES, ACTIVITY_KEY) VALUES (?, ?, ?, ?)
    2013-10-29 10:30:50,582  - bind => [2900830, 0, Create Task, 8590870]
    2013-10-29 10:30:50,926  - INSERT  INTO ACTIVITY (TICKET_KEY, VERSION, NOTES, ACTIVITY_KEY) VALUES (?, ?, ?, ?)
    2013-10-29 10:30:50,926  - bind => [326450, 1, Created Ticket, 8590860]
    Here are the queries generated from toplink version 10.x
    2013-10-26 23:31:10,426   SELECT SEQ_ACTIVITY.NEXTVAL FROM DUAL
    2013-10-26 23:31:10,430   INSERT INTO ACTIVITY (TASK_KEY, ACTIVITY_KEY,NOTES, VERSION) VALUES (?, ?, ?, ?)
    2013-10-26 23:31:10,430   bind => [2900690, 8590500, Create Task, 0]
    2013-10-26 23:31:10,509   INSERT INTO ACTIVITY (TASK_KEY, ACTIVITY_KEY, NOTES, VERSION) VALUES (?, ?, ?, ?)
    2013-10-26 23:31:10,510   bind => [null, 8590490, Created Ticket, 1]
    It appears like the new version of the toplink caching the prepared statements and it is not recognizing the targetForeignKeyFieldName mapping of the Ticket Project.
    Any help in resolving this issue is appreciated.
    Thanks

    Hi James,
    1)Yes it supports IE 8 .Please review the below link for certification details on browers :-
        http://www.oracle.com/technetwork/middleware/ias/downloads/as-certification-r2-101202-095871.html#BAJGCBEA
         Note: Oracle Application Server supports only those browsers.
    2)Forms only support Windows 7 32 bit only.
        Please refer to the note:1292919.1 "Certification of Oracle Developer Suite 10g (10.1.2) on Windows 7 (32-bit)"
    3)Could you provide more information of JVM because when you install 10gR2 it has JDK and JRE present in it.
    Regards,
    Prakash.

  • Sap Query Web Reporting - Issues with accents

    Hi,
    We was using Web Reporting for Sap Querys, throw this tool we can generate automatically web reports.
    When we go to generated web report, selection screen show us character &#56292; instead accent letters.
    In addition to this, generated web report shows two buttons with german text: "report ausf?" and "Werte zur?zen".
    Guaranteed Rewards points.

    Hi Peluka,
    are these web report generate by SAp Query ITS based. If yes this is the right forum to ask, if no I would sugest to ask in the BI forum.
    Best regards,
    Klaus

  • Issue with join condition while using in the corelated sub query

    Bees,
    I am not able to use the below query since i have used a join condition in the corelated sub qery inline view.But i have a requirement like this . Please help me on this
    select * from dept d
    where exists (select 1 from (
    select deptno
    from emp where deptno= d.deptno)
    Thank you
    Boooo

    Hi,
    I've never seen a general solution for how to reference columns from main query a from sub-query c, where c is is sub-query of b, which is a sub-query of a.
    Whenever I've wanted to, I've been able to get the desired results with a different approach.
    In this case, you seem to want
    SELECT     *
    FROM     dept     d
    WHERE     EXISTS     (
              SELECT     1
              FROM     emp
              WHERE     deptno     = d.deptno
              );I'm guessing at your data and desired output.

  • Query Rewrite ISSUE (ANSI JOINS do not work, traditional join works ) 11gR2

    For some types of queries constructed with ANSI JOINS, materialized views are not being used.
    This is currently increasing time on various reports since we cannot control the way the queries are generated(Tableau Application generates and runs queries against the STAR Schema).
    Have tried to debug this behavior using DBMS_MVIEW.EXPLAIN_REWRITE and mv_capabilities function without any success.
    The database is configured for query rewrite: REWRITE INTEGRITY, QUERY REWRITE ENABLED and other settings are in place.
    Have successfully reproduced the issue using SH Sample schema:
    Q1 and Q2 are logically identical the only difference between them being the type of join used:
    Q1: ANSI JOIN
    Q2: Traditional join
    Below is an example that can be validated on SH sample schema.
    Any help on this will be highly appreciated.
    -- Q1: the query is generated by an app and needs to be rewritten with materialized view
    SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust
    INNER JOIN countries cntr
       ON cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;
    -- Q2: the query with traditional join is rewritten with materialized view
    SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust
    INNER JOIN countries cntr
       ON cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;Tested both queries with the following materialized views:
    CREATE MATERIALIZED VIEW MVIEW_TEST_1
    ENABLE QUERY REWRITE
    AS
    SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust
    INNER JOIN countries cntr
       ON cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;
    CREATE MATERIALIZED VIEW MVIEW_TEST_2
    ENABLE QUERY REWRITE
    AS
    SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust,  countries cntr
    WHERE cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;Explain Plans showing that Q1 does not use materialized view and Q2 uses materialized view
    SET AUTOTRACE TRACEONLY
    --Q1 does not use MVIEW_TEST_1
    SQL> SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust
    INNER JOIN countries cntr
       ON cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;  2    3    4    5 
    511 rows selected.
    Execution Plan
    Plan hash value: 1218164197
    | Id  | Operation           | Name       | Rows  | Bytes |TempSpc| Cost (%CPU)| Time       |
    |   0 | SELECT STATEMENT      |        |   425 | 12325 |       |   916   (1)| 00:00:11 |
    |   1 |  HASH GROUP BY           |        |   425 | 12325 |       |   916   (1)| 00:00:11 |
    |   2 |   VIEW                | VM_NWVW_1 | 55500 |  1571K|       |   916   (1)| 00:00:11 |
    |   3 |    HASH GROUP BY      |        | 55500 |  1842K|  2408K|   916   (1)| 00:00:11 |
    |*  4 |     HASH JOIN           |        | 55500 |  1842K|       |   409   (1)| 00:00:05 |
    |   5 |      TABLE ACCESS FULL| COUNTRIES |    23 |   414 |       |     3   (0)| 00:00:01 |
    |   6 |      TABLE ACCESS FULL| CUSTOMERS | 55500 |   867K|       |   405   (1)| 00:00:05 |
    --Q2 uses MVIEW_TEST_2
    SQL> SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
    FROM customers cust,  countries cntr
    WHERE cust.country_id = cntr.country_id
    GROUP BY cntr.country_subregion, cust_year_of_birth;  2    3    4 
    511 rows selected.
    Execution Plan
    Plan hash value: 2126022771
    | Id  | Operation               | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT          |              |     511 | 21973 |       3   (0)| 00:00:01 |
    |   1 |  MAT_VIEW REWRITE ACCESS FULL| MVIEW_TEST_2 |     511 | 21973 |       3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------Database version 11gR1 (Tested also on 11gR2)
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    Thanks for the formatting tips.
    Just found an Oracle Bug which explains the above behavior.
    Unfortunately the bug will be fixed only in 12.1 Release so as a workaround will try to use traditional joins.
    For those who have metalink access see [Bug 10145667 : ERRORS TRYING TO REWRITE QUERY WITH EXACT TEXT MATCH TO MVIEW]

  • Performance issue with joins on table VBAK, VBEP, VBKD and VBAP

    hi all,
    i have a report where there is a join on all 4 tables VBAK, VBEP, VBKD and VBAP.
    the report is giving performance issues because of this join.
    all the key fields are used for the joining of tables. but some of the non-key fields like vbap-vstel, vbap-abgru and vbep-wadat are also part of select query and are getting filled.
    because of these there is a performance issue.
    is there any way i can improve the performance of the join select query?
    i am trying "for all entries" clause...
    kindly provide any alternative if possible.
    thanks.

    Hi,
    Pls perform some of the below steps as applicable for the performance improvement:
    a) Remove join on all the tables and put joins only on header and item (VBAK & VBAP).
    b) code should have separate select for VBEP and VBKD.
    c) remove the non key fields from the where clause. Once you retrieve data from the database into the internal table, sort the table and delete the entries which are not part of the non-key fields like vstel, abgru and wadat.
    d) last option is you can create index in the VBAP & VBEP table with respect to the fields vstel, abgru & wadat ( not advisable)
    e) buffering option on database tables also possible.
    f) select only the fields into the internal table that are applicable for the processing logic and also the select query should contaian the field names in the same order as mentioned in the database table.
    Hope this helps.
    Regards
    JLN

  • Bi publisher report issues with selecting multiple parameters.

    Hi there I have a Bi publisher report when I query it for a single parameter it works fine and gives me the result.
    But when I select multiple parameters Lets say I have selected 3 parameters and try to view the results it does nt give me a proper report. It leaves me some blanks and gives me negative values.
    The report is working finr for one parameter In order to select two parameters I added the following code in the sql query
    and ( coalesce(null, :JOB_ID) is null
    or c.JOB_ID in (:JOB_ID)) .
    Can some one please let me know if this is correct or should I have to add anything else in the query.
    Even if I hard code it by saying JOB ID IN ('x','y','Z') and try to run the report it is not giving me exact values.
    BUt when I run the same query in database am getting correct values..
    Can anyone help me with this issue please??
    Thanks

    1. What version of BIP are you using?
    2. Can you please paste here your complete SQL data model?
    3. Can you get us an example how this will work?
    4. Can you be more specific about the error you get and the output?
    thanks
    Jorge

Maybe you are looking for

  • How to Export Data from a table in database directly to Excel.

    Hi, I have some sqls that i need to run on a daily basis.My client wants them to be scheduled through a job and the result output of the query should be in the form of Excel. Now i am no sure how to do this.Is there any in-built function in the DBMS

  • Problem in Material create through BAPI

    Hi All,          For creating MATERIAL first used BAPI_MATERIAL_GETINTNUMBER for material no generation and for creation material master BAPI_MATERIAL_SAVEDATA. <garbled code removed> Moderator message: Post relevant portions of the code only! My pro

  • Apple sending mail to address not listed in my account

    [email protected] sent me emails to an account that i want to remove, but when I log into iCloud that address isn't listed there. Very confused and don't want to discard the address if apple thinks its active Any ideas? could there be somewhere else

  • Trying to find information for In Store Credit on IPhone

    I am trying to figure out how to get the $100.00 instore credit I heard we could get if we bought the IPhone in the first few weeks.

  • Showing self made video with Nokia 3600slide

    Hello! I have a Nokia 3600 slide and I use Linux for video editing.The 3600 slide comes with a pre-installed video that has his format: Material.mp4: ISO Media, MPEG v4 system, version 2 Ok, so I created a video with the well known MEncoder software