Query Filters problem!

HI,
I have a query which has the filters
ex: Project profile filter on ZP025,ZPDS014,ZP016,ZP018,ZP019
the query is not producing any result.But when i remove the filter for ZP025 and ZPDS014 it is producing result.
What whould be the reason for this behaviour.Why the query is not producing anz result with particular filters.
thank you
venkat

Venku,
    Looks like your cube only has information for project profiles ZP025 and ZPDS014. Make sure you have data for other profiles too if you are expecting to see some values with the ZP025,ZPDS014,ZP016,ZP018,ZP019 filter.
Hope this helps...

Similar Messages

  • Structure data in the spreadsheet using BEx Query filtered by year

    Hi,
    I´m making a Balanced Scoredcard using Xcelsius and extracting data from SAP BI.   The customer asked to see a few KPI´S (Return on assets and profit margin) filtering data from the dashboard by year,  month and region.
    The problem I´m facing is how to structure the data in the spreadsheet using a query filtered by year variable. 
    Regards,
    Diego

    Hi,
    I´m making a Balanced Scoredcard using Xcelsius and extracting data from SAP BI.   The customer asked to see a few KPI´S (Return on assets and profit margin) filtering data from the dashboard by year,  month and region.
    The problem I´m facing is how to structure the data in the spreadsheet using a query filtered by year variable. 
    Regards,
    Diego

  • Date object doesn't work in query filters

    I'm trying to create a universe object called Next Biweekly Pay End Date.  Some background: there is an end date for our biweekly payrolls every 14 days, and the logic behind the object is basically that if there was a biweekly pay end date 7 days ago, the next one is 7 days from today (that is, sysdate + 7), etc.</p>
    I have it working so that it displays the correct date when used in a WebI report.  However, when I use it in a query filter in a WebI report (like, Pay End Date = Next Biweekly Pay End Date), I don't get an error, but I also don't get any data.  Somehow my object doesn't work in a query filter.  The purpose of the object is for use in query filters, so I need to get this to work.</p>
    My best guess about why it doesn't work in a query filter is due to some issue with the data type.  Pay End Date has a data type of date in the universe.  I gave Next Biweekly Pay End Date a data type of date also, but the query filter still doesn't work; I get "no data to fetch."</p>
    We're using XI 3.1.6 and Oracle 10.  Any ideas about how to get this to work?</p>
    If it helps, here is the definition of Next Biweekly Pay End Date.  The logic is that it takes today's date, subtracts Oct. 31, 2009 (a biweekly pay end date), divides by 14, and looks at the remainder.  If the remainder is 0, then today is a pay end date and the next one is 14 days from now.  If the remainder is 1, yesterday was a pay end date and the next one is 13 days from now, etc.</p>
    case</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 0 then (sysdate + 14)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 1 then (sysdate + 13)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 2 then (sysdate + 12)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 3 then (sysdate + 11)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 4 then (sysdate + 10)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 5 then (sysdate + 9)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 6 then (sysdate + 8)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 7 then (sysdate + 7)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 8 then (sysdate + 6)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 9 then (sysdate + 5)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 10 then (sysdate + 4)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 11 then (sysdate + 3)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 12 then (sysdate + 2)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 13 then (sysdate + 1)</p>
    end

    Thanks for the suggestions.
    I did some more testing, and there seems to be something more complicated going on.  I ran the following code in SQL*Plus:
    SELECT distinct M_PYDW1.PYSTATUS.DW_OWNER,
    case
    when to_date(sysdate, 'dd/mm/yyyy hh24:mi:ss') >= to_date('01/01/2010','dd/mm/yyyy hh24:mi:ss') then To_Date((sysdate - 2),'dd/mm/yyyy')
    else to_date(sysdate +2, 'dd/mm/yyyy')
    end
    FROM M_PYDW1.PYSTATUS
    The condition should be true, because the sysdate (today is Jan. 20) is greater than 1/1/2010, so I should get a result of sysdate - 2 (Jan. 18).  But the result I get is Jan. 22 (sysdate +2).  It seems that the comparison is failing even though I'm formatting both sysdate and 1/1/2010 as dates with a timestamp.  What could cause that?
    One more mystery: when I run the same code as above in a WebI report (using custom SQL), I get the error ORA-1830, date format picture ends before converting entire input string.

  • About query related problem

    hi ,
           we are generate query in 2005b,and procced for execuite query.following problem occure'<b>odbc sql server driver'[sql server] syntax error the converting the nvarchar value' 70302/20307' to column of data type int received alert OAIB</b>
    QUERY SHOWN BE AS FOLLOW.
    SELECT T5.DocNum as'Po. No. ', T5.DocDate as 'Po Date',T0.CreateDate,T5.NumAtCard as 'Man.PO. No/ Dt.', T0.DocNum as'AP No. ', T0.DocDate as 'AP Date',T0.NumAtCard as 'Vendor Ref. No.', T0.U_vbdt as 'Vendor Ref. Date', T0.CardName as 'Vendor', T1.Dscription as 'Item',  T1.Quantity AS 'QTY'  , T1.Price as 'Basic Rate', (T1.Price *T1.Quantity) as 'Value',T0.Comments as 'Po No. & Po.Dt.' FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OPDN T3 ON T2.CardCode = T3.CardCode INNER JOIN PDN1 T4 ON T3.DocEntry = T4.DocEntry INNER JOIN OPOR T5 ON T2.CardCode = T5.CardCode INNER JOIN POR1 T6 ON T5.DocEntry = T6.DocEntry INNER JOIN OITM T7 ON T1.ItemCode = T7.ItemCode INNER JOIN OITB T8 ON T7.ItmsGrpCod = T8.ItmsGrpCod WHERE (  T1.BaseRef  =  T3.DocNum )  AND ( T4.BaseRef =  T5.DocNum ) AND (  T0.U_vbdt >=[%25]AND  T0.U_vbdt <=[%26]) AND ( T4.Dscription =T1.Dscription ) AND ( T4.Dscription = T6.Dscription  ) AND  (( T1.Dscription=[%0] OR T1.Dscription=[%1] OR T1.Dscription=[%2] OR T1.Dscription=[%3] OR T1.Dscription=[%4] OR T1.Dscription=[%5] OR T1.Dscription=[%6] OR T1.Dscription=[%7] OR T1.Dscription=[%8] ) OR ( T0.CardName=[%10] OR T0.CardName=[%09] OR T0.CardName=[%27] OR T0.CardName=[%28] ) OR ((  T8.ItmsGrpNam =[%11]  oR T8.ItmsGrpNam =[%12] OR T8.ItmsGrpNam =[%13] OR T8.ItmsGrpNam =[%14] OR T8.ItmsGrpNam =[%15] OR T8.ItmsGrpNam =[%16] OR T8.ItmsGrpNam =[%17] OR T8.ItmsGrpNam =[%18] OR T8.ItmsGrpNam =[%19] ) and  ( T7.U_FirmName =[%20] OR T7.U_FirmName =[%21] OR T7.U_FirmName =[%22] 
    oR T7.U_FirmName =[%23] OR T7.U_FirmName =[%24] )) )

    Hi Vishal,
    the value '70302/20307' is not an whole number so converting it to an int is not possible.
    You should check your data for this value an change your query or data.
    Regards
    Ad

  • Query designing problem while applying cell properties

    Hello Experts,
    I have a problem while designing query. Problem is as follow:
    I have a calculated field on key figure column. This key figure calculates variance between 2 columns.
    for E.g I have 2 columns Budget and Actual and third column is %Variance which should be          
    1. ((Actual - Budget)/Budget) *100 or
    2. ((Budget -Actual)/Budget)*100, depening on some values on the row i should use any of these 2 formulas but the result should be dispalyed in single column % Variance.
    how can i change the formula in key figures depending on these conditions. I can achieve this by applying cells but i dont want to do so as it is very complex way to desing these queries.
    also let me know applying cells on query affects its performance or not?
    Regards,
    Nirav

    Hi Nitin,
    Your reply may help me.
    But my exact requirement is not that. Requirement is as follow:
    I have created Char. Structure in row which contains few rows as revenue and few rows as expense.
    I created them by creating selections. Now in case of expense the variance should be                (Budget-Actual)/Budget *100.
    In case of revenue variance should be (Actual-Budget)/Budget *100.
    So, here i have to find out revenue & expense char. iresspective of which one is greater.
    Regards,
    Nirav

  • Query has problem

    Below query has problem .
    Pls see the queries for Usage Summary with Partition and Without Partition
    . I have executed this now so it may be in Buffer …****
    DB Query ... SUM from event objects, bin variables
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    --                   and event.Poid_id0 >= 266838277921701888****
    --                 and event.Poid_id0 < 267928993456455680****
    --               and ebal.obj_id0 >= 266838277921701888****
    --             and ebal.obj_id0 < 267928993456455680****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
    resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    and event.Poid_id0 >= 264199450015039488****
    and event.Poid_id0 < 265237388991660032****
    and ebal.obj_id0 >= 264199450015039488****
    and ebal.obj_id0 < 265237388991660032****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    --

    848478 wrote:
    Below query has problem .
    Pls see the queries for Usage Summary with Partition and Without Partition
    . I have executed this now so it may be in Buffer …****
    DB Query ... SUM from event objects, bin variables
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    --                   and event.Poid_id0 >= 266838277921701888****
    --                 and event.Poid_id0 < 267928993456455680****
    --               and ebal.obj_id0 >= 266838277921701888****
    --             and ebal.obj_id0 < 267928993456455680****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
    resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    and event.Poid_id0 >= 264199450015039488****
    and event.Poid_id0 < 265237388991660032****
    and ebal.obj_id0 >= 264199450015039488****
    and ebal.obj_id0 < 265237388991660032****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    --Consider getting the asterisk key fixed, since it results in invalid SQL syntax

  • Displaying Query filters on a report to print

    I would like to display the query filters that I have used in my query filters display on the report, is there any way to do this? Are you able to create a variable and populate it with the query filters?

    yes
    you can use a function called
    UserResponse
    =UserResponse("My Filter Text here")
    or if you have more than one query
    =UserResponse([Query 1];"My Filter Text here")

  • WIS 00015 error- Multiple Query Filters contain a prompt with same name

    Hi
            I am working BOXIR2 environment. I created two prompts at Universe level- one of Date field and one on agency name field.
    syntax for the prompts is
    customerInfo.RSRCE_NAME =  @Prompt('Enter value(s) for AgencyName ','A' , , ,)
    datetable.STARDATE =datetable.STARDATE.STARTDATE =  @Prompt(' 'Enter value(s) for StartDate:','D' , , ,)
    When I include even one of  the prompts in the report I am getting an error WIS 00015 Multiple Query Filters contain a prompt with the same text, but the prompts use a different operand type.
    If I try to change text of one of the prompts in Universe selection statement, then I see the prompt two times in the report.
    Please let me know how to overcome this issue.

    Ok, I've simplified the case.
    Here is the real case :
    Object filter =
    Based on object =
    .[LEVEL01]
    Object filter =
    Based on object =
    .[LEVEL01]
    In WBI query result I take these objects :
    .[LEVEL01]
    .[LEVEL01]
    .[4IUX93YJGXQEHGLX0T0GPNA9Y]
    In query filters, my 2 filters with same text :
    1.
    I run the query.
    Answer to question 'Single Year Period ?' = Period 06 2010
    ==> MDX error
    A database error occured. The database error text is: Echec de l'exécution de la requête MDX SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006] avec l'erreur Invalid MDX command with . (WIS 10901)
    And you can see that the value sent to both filters is the same and come from the first filter .[Z12010006] instead of applying the value to each filter .[Z12010006] for the first one and .[Z12010006] for the second one.
    Please, notice that if I change the order of this 2 filters in the WBI query, the MDX generated become :
    SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006]
    Thanks for your help.
    G.OM.

  • Failure to search - query window problem

    Hello again,
    Have anyone of you came across a problem with SAP search mechanism in query window attached to document field? I've created a simple query of "Select acctcode,acctname from OACT where acctcode like '2%' and postable='Y' order by acctcode" and attached it to one of document fields (doesn't matter which one). When I run this query a usual window poped up with a search field on the top, but when I typed "2" in it, selection bar moved right into first 231 account ignoring any of the lesser numbers. There is more - when I changed query to search for '5%' like accounts, I gained the same result - accounts less than 530 were ignored even if I typed "50" or "51". BUT - when I changed query sort order to "desc", all account became "findable".
    I got this problem in one database only which is SAP 8.8 PL10 version upgraded recently from 2007A one. I've checked with a newly created 8.8 and such problem hasn't occured.

    Hello Thomasz,
    I might be off base here, what happens when you use this??? 
    Do you get the same types of query window problem???
    Select
    acctcode,
    acctname,
    segment_0
    from OACT
    where Segment_0 like '2%'
    order by acctcode
    for browse
    Regards,
    Zal

  • Query filters in QueryListener

    How to get the query filters in the Query Listener .
    For eg. I have a serach component having name and email id as filters. I want to get these values in my QueryListner.
    Thanks
    Suneesh

    Hi,
    see sample #30 at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html
    Frank

  • Query Performance problem after upgrade from 8i to 10g

    Following query takes longer time in 10g.
    SELECT LIC_ID,FSCL_YR,KEY_NME,CRTE_TME_STMP,REMT_AMT,UNASGN_AMT,BAD_CK_IND,CSH_RCPT_PARTY_ID,csh_rcpt_id,REC_TYP,XENT_ID,CLNT_CDE,BTCH_CSH_STA,file_nbr,
    lic_nbr,TAX_NBR,ASGN_AMT FROM (
    SELECT /*+ FIRST_ROWS*/
         cpty.lic_id,
    cpty.clnt_cde,
    cpty.csh_rcpt_party_id,
    cpty.csh_rcpt_id,
    cpty.rec_typ,
    cpty.xent_id,
    cr.fscl_yr,
    cbh.btch_csh_sta,
    nam.key_nme,
    lic.file_nbr,
    lic.lic_nbr,
    cr.crte_tme_stmp,
    cr.remt_amt,
    cr.unasgn_amt,
    ee.tax_nbr,
    cr.asgn_amt,
    cr.bad_ck_ind
    FROM lic lic
    ,csh_rcpt_party cpty
    ,name nam
    ,xent ee
    ,csh_rcpt cr
    ,csh_btch_hdr cbh
    WHERE 1 = 1
    AND ee.xent_id = nam.xent_id
    AND cbh.btch_id = cr.btch_id
    AND cr.csh_rcpt_id = cpty.csh_rcpt_id
    AND ee.xent_id = cpty.xent_id
    AND cpty.lic_id = lic.lic_id(+)
    AND (cpty.clnt_cde IN ( SELECT clnt_cde
    FROM clnt
                   START WITH clnt_cde = '4006'
    CONNECT BY PRIOR clnt_cde_prnt = clnt_cde)
    OR cpty.clnt_cde IS NULL)
    AND nam.cur_nme_ind = 'Y'
    AND nam.ent_nme_typ = 'P' AND nam.key_nme LIKE 'WHITE%')
    order by lic_id
    Explain Plan in 8i
    0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=17 Card=1
    Bytes=107)
    1 0 FILTER
    2 1 NESTED LOOPS (Cost=17 Card=1 Bytes=107)
    3 2 NESTED LOOPS (Cost=15 Card=1 Bytes=101)
    4 3 NESTED LOOPS (OUTER) (Cost=13 Card=1 Bytes=73)
    5 4 NESTED LOOPS (Cost=11 Card=1 Bytes=60)
    6 5 NESTED LOOPS (Cost=6 Card=1 Bytes=35)
    7 6 INDEX (RANGE SCAN) OF 'NAME_WBSRCH1_I' (NON-UN
    IQUE) (Cost=4 Card=1 Bytes=26)
    8 6 TABLE ACCESS (BY INDEX ROWID) OF 'XENT' (Cost=
    2 Card=4649627 Bytes=41846643)
    9 8 INDEX (UNIQUE SCAN) OF 'EE_PK' (UNIQUE) (Cos
    t=1 Card=4649627)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT_PARTY
    ' (Cost=5 Card=442076 Bytes=11051900)
    11 10 INDEX (RANGE SCAN) OF 'CPTY_EE_FK_I' (NON-UNIQ
    UE) (Cost=2 Card=442076)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'LIC' (Cost=2 Car
    d=3254422 Bytes=42307486)
    13 12 INDEX (UNIQUE SCAN) OF 'LIC_PK' (UNIQUE) (Cost=1
    Card=3254422)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT' (Cost=2
    Card=6811443 Bytes=190720404)
    15 14 INDEX (UNIQUE SCAN) OF 'CR_PK' (UNIQUE) (Cost=1 Ca
    rd=6811443)
    16 2 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_BTCH_HDR' (Cost=
    2 Card=454314 Bytes=2725884)
    17 16 INDEX (UNIQUE SCAN) OF 'CBH_PK' (UNIQUE) (Cost=1 Car
    d=454314)
    18 1 FILTER
    19 18 CONNECT BY
    20 19 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (UNIQUE) (Cost=1 Ca
    rd=1 Bytes=4)
    21 19 TABLE ACCESS (BY USER ROWID) OF 'CLNT'
    22 19 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (Cost=2 Card
    =1 Bytes=7)
    23 22 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (UNIQUE) (Cost=1
    Card=1)
    Explain Plan in 10g
    0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=19 Card=1
    Bytes=112)
    1 0 SORT (ORDER BY) (Cost=19 Card=1 Bytes=112)
    2 1 FILTER
    3 2 NESTED LOOPS (Cost=18 Card=1 Bytes=112)
    4 3 NESTED LOOPS (Cost=16 Card=1 Bytes=106)
    5 4 NESTED LOOPS (OUTER) (Cost=14 Card=1 Bytes=78)
    6 5 NESTED LOOPS (Cost=12 Card=1 Bytes=65)
    7 6 NESTED LOOPS (Cost=6 Card=1 Bytes=34)
    8 7 INDEX (RANGE SCAN) OF 'NAME_WBSRCH1_I' (INDE
    X) (Cost=4 Card=1 Bytes=25)
    9 7 TABLE ACCESS (BY INDEX ROWID) OF 'XENT' (TAB
    LE) (Cost=2 Card=1 Bytes=9)
    10 9 INDEX (UNIQUE SCAN) OF 'EE_PK' (INDEX (UNI
    QUE)) (Cost=1 Card=1)
    11 6 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT_PAR
    TY' (TABLE) (Cost=6 Card=1 Bytes=31)
    12 11 INDEX (RANGE SCAN) OF 'CPTY_EE_FK_I' (INDEX)
    (Cost=2 Card=4)
    13 5 TABLE ACCESS (BY INDEX ROWID) OF 'LIC' (TABLE) (
    Cost=2 Card=1 Bytes=13)
    14 13 INDEX (UNIQUE SCAN) OF 'LIC_PK' (INDEX (UNIQUE
    )) (Cost=1 Card=1)
    15 4 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT' (TABLE
    ) (Cost=2 Card=1 Bytes=28)
    16 15 INDEX (UNIQUE SCAN) OF 'CR_PK' (INDEX (UNIQUE))
    (Cost=1 Card=1)
    17 3 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_BTCH_HDR' (TAB
    LE) (Cost=2 Card=1 Bytes=6)
    18 17 INDEX (UNIQUE SCAN) OF 'CBH_PK' (INDEX (UNIQUE)) (
    Cost=1 Card=1)
    19 2 FILTER
    20 19 CONNECT BY (WITH FILTERING)
    21 20 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (TABLE) (C
    ost=2 Card=1 Bytes=15)
    22 21 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (INDEX (UNIQUE)
    ) (Cost=1 Card=1)
    23 20 NESTED LOOPS
    24 23 BUFFER (SORT)
    25 24 CONNECT BY PUMP
    26 23 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (TABLE)
    (Cost=2 Card=1 Bytes=7)
    27 26 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (INDEX (UNIQU
    E)) (Cost=1 Card=1)
    28 20 TABLE ACCESS (FULL) OF 'CLNT' (TABLE) (Cost=5 Card
    =541 Bytes=5951)
    Explain plan looks different in steps 19 to 28. I am not sure why 10g have more steps

    Hi
    I have no experience in 8i. I do know 10g does costing different from 8i. So I think the other plan might got elliminated.
    Normally when I see differences. I just collect statistics on the tables and the indexes and remove the hints. Hints are not good . This has helped me to solve few problems.
    Thanks
    CT

  • Query rewrite problem related to FGAC/RLS/VPD

    My problem in related to Fine Grained Access Control / DBMS_RLS.
    Let's start with a simple example and elaborate further.
    Basic problem:
    Let's say we have two tables:
    create table LEVEL1( L1NR NUMBER not null, TAG NUMBER);
    alter table LEVEL1 add constraint LEVEL1_PK primary key (L1NR);
    create table LEVEL2( L1NR NUMBER, L2NR NUMBER not null);
    alter table LEVEL2 add constraint LEVEL2_PK primary key (L2NR);
    alter table LEVEL2 add constraint LEVEL2_FK foreign key (L1NR) references LEVEL1 (L1NR);
    I want to convince the database to rewrite a query that looks like this:
    A)
    SELECT L1.TAG, L2.L2NR
    FROM
    LEVEL2 L2
    INNER JOIN LEVEL1 L1
    ON L2.L1NR = L1.L1NR
    WHERE
    EXISTS( SELECT 1 FROM LEVEL1 L1B WHERE L1B.L1NR = L2.L1NR)
    As L2 will be joined to L1 for my human eye and mind
    it is obvious that the where clause is redundant,
    and the query is equivalent to:
    B)
    SELECT L1.TAG, L2.L2NR
    FROM
    LEVEL2 L2
    INNER JOIN LEVEL1 L1
    ON L2.L1NR = L1.L1NR
    Is there any way to convince the parser/optimizer to remove the redundant join?
    Why do I have a query like A) and why I cannot rewrite it myself I will explain below.
    For those to ask themselves why do I need such a thing let me elaborate.
    We develop an application and we want to enforce security on the data at the row level.
    The problem is more complicate than my following example, but the example is good enough.
    Let's say that we have an application that makes invoices.
    We want to give a user the privilege to make reports on the invoices issued for a category of customers.
    I see three main ways to enforce row level security on data:
    1) At the application level
    2) Using views
    3) Using Fine Grained Access Control / DBMS_RLS
    Choice 1) is more flexible, but it has a major drawback:
    You cannot make the database available for reporting with BI/ad-hoc reporting tools.
    And also you have to be careful with every query you write. Or create something that takes care of the security, which can be really tricky.
    And it also makes report creation for the application difficult since you need to embed the security system into the reporting module.
    If you use Crystal Reports or some other reporting tool to build your application report you've got a problem.
    Choices 2) and 3) are somewhat similar, but 3) is more flexible
    For those who don't know how FGAC/DBMS_RLS works and don't want to dig deeper here is a short explanation:
    DBMS_RLS allows the database developer to attach dynamic where clauses to queries.
    It does this by rewriting queries like:
    "select blabla from employees"
    to "select blabla from (select * from employees where <some expression that filters the data according to the user's policy>)"
    The filters are attached on a table by table basis, so queries like:
    SELECT dept.NAME, empl.NAME
    FROM
    DEPARTMENT dept
    INNER JOIN employees empl
    are rewritten to
    SELECT dept.NAME, empl.NAME
    FROM
    (SELECT * FROM DEPARTMENT WHERE <FILTER_DEPT>) dept
    INNER JOIN (SELECT * FROM employees WHERE <FILTER_EMP>) empl
    So far so good, nothing looks bad, but the devil is in the detail
    Back to our reporting problem.
    Let's say we have a scenario simpler than life, and I associate the user directly to a customer category by adding a CUST_CAT_ID column to the APP_USER table.
    I want restrict the user to see only the data associated to its category (category, customers, invoices, invoice item)
    So when he writes "select NAME, ADDRESS from customer" the query is rewritten to
    "select NAME, ADDRESS from (SELECT * FROM CUSTOMER WHERE (EXISTS SELECT 1 FROM category join app_user on ... where customer.CUST_CAT_ID = app_user.CUST_CAT_ID and app_user.login = get_current_user()))"
    where get_current_user is some framework function that gives me the current user.
    A little complicated, but nothing too scary.
    But when I write something like:
    SELECT <relevant columns> FROM category cat JOIN customer cust JOIN invoice inv JOIN invoice_item item WHERE <some filters>
    ...(query totally legitimate for a sales report), this gets expanded to a scary query that looks like this:
    SELECT <relevant columns>
    FROM
    (SELECT * FROM category WHERE (EXISTS SELECT 1 FROM app_user u WHERE u.CUST_CAT_ID = CAT_ID AND u.login = get_current_user())) cat
    JOIN (SELECT * FROM customer WHERE(EXITS SELECT 1 FROM category JOIN app_user WHERE ...)) cust
    JOIN (SELECT * FROM invoice WHERE(EXITS SELECT 1 FROM customer JOIN category JOIN app_user WHERE ...)) inv
    JOIN (SELECT * FROM invoice_item WHERE(EXITS SELECT 1 FROM invoice JOIN customer JOIN category JOIN app_user WHERE ...)) item
    WHERE
    <some filters>
    Oops! A query with 4 tables is expanded to a 14 tables query, when all I really need is:
    SELECT <relevant columns>
    FROM category cat JOIN customer cust JOIN invoice inv JOIN invoice_item item
    WHERE <some filters> AND (EXISTS SELECT 1 FROM app_user u WHERE u.CUST_CAT_ID = CAT_ID AND u.login = get_current_user())
    Let me tell you that we don't use here roles and privileges tables that we must use in a real life scenario.
    In a real life scenario we will easily transform the original query in a 20-30 table join (grrrrrrr).
    Well, I cannot change the way DBMS_RLS/FGAC works, and also if I choose to use views I cannot write a filtered view for every possible join that a user might create.
    All I want is to find out if there is any way to instruct the parser/optimizer, using primary and foreign keys, optimizer parameters hints and other methods, to rewrite the query and eliminate redundant joins.
    Of course I can create some materialized views or bitmap join indexes to help me in the process and speed up the query, but using this method in a database that has hundreds of tables can be a little problem in terms of management and performance.

    Hello again,
    It appeared that, the problem is present only when I try the query in pl/sql developer.
    For some reason, even though I set QUERY_REWRITE_INTEGRITY to STALE_TOLERATED, it behaved as this parameter was set to ENFORCED.
    So the case was that:
    for session - STALE_TOLERATED
    for system - ENFORCED
    In v$parameter2 against "QUERY_REWRITE_INTEGRITY" was shown "stale_tolerated", but the query was not rewritten.
    When I do the same (altering the session and perform the select query) in SQLPlus, everything works as expected - the query is rewritten.
    And I conclude the problem is in PL/SQL Developer (my version is 8.0.1.1498) or something related to this.
    Edited by: Verdi on 2010-2-12 14:00

  • XML Query filtering by child table column

    Hello,
    If anyone can help with this one... it would be nice. I need to make the output of an query to be in the format of XML, but the problem is that the initial filtering needs to be done in the child table.
    Example:
    CREATE TABLE PRIMARY(
    ID NUMBER(19,0),
    CODE_PRIMARY VARCHAR2(32));
    CREATE TABLE SECONDARY(
    ID NUMBER(19,0),
    IDPRIMARY(19,0),
    CODE_SECONDARY VARCHAR2(32));
    INSERT INTO PRIMARY(ID,CODE_PRIMARY)
    VALUES (1,'A');
    INSERT INTO PRIMARY(ID,CODE_PRIMARY)
    VALUES (2,'B');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (1,1,'C');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (2,1,'D');
    INSERT INTO SECONDARY(ID,IDPRIMARY,CODE_SECONDARY)
    VALUES (3,2,'E');
    Now what we need is to build an XML tree like the following, INNER JOINING PRIMARY and SECONDARY tables with this condition in the where clause -> WHERE SECONDARY.CODE IN ('C','D')
    <result>
    <record>
    <id>1</id>
    <code>A</code>
    <childs>
    <child>
    <id>1</id>
    <idprimary>1</idprimary>
    <codesecondary>C</codesecondary>
    </child>
    <child>
    <id>2</id>
    <idprimary>1</idprimary>
    <codesecondary>D</codesecondary>
    </child>
    </childs>
    </record>
    </result>
    In this example only one record is returned since we only have one record in PRIMARY table that has a child having codesecondary=C or D. The ideia is to get many records... but I think that this is enough for the sake of the example. And the solution is the same.
    Thanks in advance!
    GM

    Found the answer. Used distinct keyword instead of grouping the output table columns. This way XMLAgg didn't broke up the result:
    SELECT
    XMLElement("Processos",
    XmlAgg(XMLElement("Processo",
    XMLForest(T.ID as "Id",T.CODIGO as "Codigo",T.DESCRICAO as "Descricao"),
    XMLElement("Funcionalidades",
    SELECT
    XMLAgg(
    XMLElement("Funcionalidade",F2.ID)
    FROM TWBASEDB.LISTA_UNICA_FUNCIONALIDADE F2
    WHERE F2.ID_processo=T.ID
    and f2.ACTIVIDADE IN ('1_ACTC1','1_ACTC2','1_ACTC3','2_ACTC1')
    from
    select distinct P.ID,P.CODIGO,p.DESCRICAO
    FROM TWBASEDB.LISTA_UNICA_PROCESSOS P
    INNER JOIN TWBASEDB.LISTA_UNICA_FUNCIONALIDADE F ON P.ID=F.ID_PROCESSO
    WHERE ACTIVIDADE IN ('1_ACTC1','1_ACTC2','1_ACTC3','2_ACTC1')
    order by p.id
    ) T

  • More filtering problems

    Greetings,
    Yesterday, I posted a problem with finding an invisible filter. Many thanks to those who helped.
    Today, I have another filter problem. While searching, I noticed the same problem I had with an invisible filter, but this time when I implement the fix (i.e., open a filter HUD for a smart album, then click on the Photos item in the library) there is not an invisible filter, but rather the filter HUD contains the following line: "Source: Library Library."
    The searching appears to be normal when one of the "Library" fields is selected, but it may or may not be normal when the other "Library" is selected. The odd thing is that, when I search my hard drive, there is only one Aperture Library.
    One of the strengths of Aperture is the library functions, but I'm rapidly losing my trust in search results.
    Anyone know how to control the Library field?
    Many thanks,
    Rick

    The "Source: Library Library" line is the same as you show, but I also get the double library when filtering rules are being used.
    I tried opening the HUD of different smart albums to see if that made a difference. If the smart album filter HUD that I open is one of the "Library Albums," that Filter HUD displays "Source: Library," and when I click on the Photos item, that Filter HUD displays "Source: Library Library." If the smart album filter HUD that I open is for one of my projects, that Filter HUD displays "Source: Library {Project name}," and when I click on the Photos item, that Filter HUD displays "Source: Library Library."
    I'm having trouble re-creating the problem that initiated this query, but I'm still not getting expected results with searching. If I open a filter HUD for a smart album, then click on the Photos item in the library, there are no invisible filters being applied. The only filter checked is Rating, and when the rating is greater than or equal to "unrated," all of the photos are present. So far, so good.
    However, if I go through the process of checking for an invisible filter (i.e., open a filter HUD for a smart album, then click on the Photos item in the library), and then add a text filter criteria to the open HUD, say the street name, "Celetná," Aperture correctly finds 32 items. If I go through the process of checking for an invisible filter, close the open HUD, and then enter Celetná in the search box in the upper right corner of the brower, Aperture only finds 9 items. Similarly, if I go through the process of checking for an invisible filter, close the open HUD, and then re-open the HUD by clicking on the icon in the upper right corner of the brower and entering Celetná into the text filter, Aperture finds 9 items.
    I hope this is clear. Any ideas?

  • Querying/filtering a struct

    I'm trying to filter a cfoutput query by a string in a struct
    in
    BlogCFC. Here's a link to the test page:
    http://tinyurl.com/35ozjv
    This page contains the first query, returning posts from all
    categories,
    along with dumps of the getCategory and getEntries functions.
    The getEntries struct contains a categoryid and categoryname.
    I would
    like to filter the results by one category, "Articles" to
    return the
    blog post title and body.
    Ray posted this in his forum:
    "You pass in a struct of options. So make a struct, add
    maxentries=10 to
    it, and then pass the struct to getEntries. Then to filter by
    category,
    get the UUID value first, you can find them by calling
    getCategories,
    and then pass it in the struct by using the key, byCat. You
    can't pass
    the category name. You have to get the UUID value and use
    that."
    The problem is I have no idea how to pass the UUID to the
    struct using
    the key byCat.
    Here's my unworking code:
    <!--- Make a struct and add maxentries=10 to it --->
    <cfset passthrough = StructNew()>
    <cfset passthrough.maxentries=10>
    <!--- Pass the struct to getEntries --->
    <cfset posts =
    application.blog.getEntries(passthrough)>
    <!--- Then to filter by category, get the UUID value first
    --->
    <!--- You can find them by calling getCategories --->
    <!--- Articles UUID is:
    5D279AED-3048-72D5-0466F6D049A3D4B5 --->
    <cfset theCategory = application.blog.getCategories()>
    <!--- Then pass it in the struct by using the key, byCat
    --->
    I'm lost at this point. Any help is greatly appreciated.

    cf_dev2 wrote:
    >> What am I doing wrong?
    >
    > <cfquery dbtype="query" name="GetCategory">
    > SELECT CategoryName
    > FROM categoryInfo
    > WHERE CategoryName = 'Articles'
    > </cfquery>
    >
    > 1. Your QoQ needs to select the UUID column not
    CategoryName. Besides that
    > the QoQ looks good
    > 2. You ran the QoQ to get the uuid for "Articles", but
    then you didn't do
    > anything with the query. You need to add the UUID value
    to the structure of
    > filters that get passed to getEntries(). So the
    getEntries() function knows it
    > should only return "Articles".
    Perfect. It's much better using the QoQ WHERE instead of hard
    coding the
    Category ID. Thanks for thinking of that.
    I've updated the test page with this new code
    http://tinyurl.com/35ozjv
    <!---- get all categories --->
    <cfset qAllCategories =
    application.blog.getCategories()>
    <!---- find the UUID for the Articles category --->
    <cfquery dbtype="query" name="GetArticlesCategory">
    SELECT CategoryID
    FROM qAllCategories
    WHERE CategoryName = 'Articles'
    </cfquery>
    <!--- Make a new struct to pass the category and entries
    to --->
    <cfset filters = StructNew()>
    <cfset filters.byCat = GetArticlesCategory.CategoryID>
    <cfset filters.maxentries =10>
    <cfset posts = application.blog.getEntries(filters)>
    <!--- Query the last 10 Articles --->
    <cfoutput query="posts">
    <h3>
    <a href="#application.blog.makeLink(id)#">
    #Title#
    </a>
    </h3>
    <p>
    #body#
    </p>
    </cfoutput>

Maybe you are looking for

  • An account with some docs posted on it needs to be changed to an recon...

    Hi all I have a problem, I need to chnage an account to be an reconciliation account for vendors. The problem is that I already have some value posted on this account. I tried posting a document on it that would bring it to zero balance and then do t

  • SQL Developer 1.5.1 on XP: Abruptly aborts when laptop lid is closed

    I have SQLD 1.5.1 (latest version available for download, build 5440) on Windows XP (on a Lenovo laptop T60). When I am headed to say a meeting for example, and close the lid of the laptop so it goes to sleep/hibernate and then come back and open the

  • Query on Oracle 8

    Hi everybody, In Oracle 8, table-names cannot be more than 30 characters. Is there any way to increase it? Same problem with constraint names also. Thanks in advance, Regards, Kakoli null

  • Nxt infrared sensor output

    Hello, I am working on a project that involves the lego nxt mindstorm. In my labview block diagram, I have the nxt infrared sensor connected to a waveform output. That is, a waveform is displayed according to the movement of the robot and the infrare

  • Odi Invoke is not generating XML properly

    Hi All, In weblogic server Axis2 is deployed and it is showing Active. And we have uploaded ODI invoke service also in AXIS2 succesfully and it is showing Active status also... By using the soap its generating the XML with below mentioned error.. Can