Variable in where clause of the logical table

Hi,
is it possible to define a variable in "where" clause of rpd's physical table (table type - select)? If yes, pls elaborate the steps including how to refresh it with every end user's request?
Thanks and Regards,
Igor
P.S.
If not, is there any workaround?

Nico
thanks, but I am afraid that is not my case. I need to refresh variable value interactively with every query by a dashboard prompt. To illustrate my need just imagine a recursive SQL (defined as a view/logical table in rpd):
SELECT ....
FROM ...
WHERE ...
START WITH .... columnA=variable1
CONNECT BY PRIOR .... and columnB=varariable2;
or
SELECT c1,c2,c3,c4 from tabA where c1='A' and c2=variable1
union
SELECT c1,c2,c3,c4 from tabA where c1='A" and c2='D' and c1 NOT IN ( SELECT c1 FROM tabA where c1='A' and c2=variable1 );
So, what I want to do is to pass value(s) to my variable(s) every time when respective select (view) is executed. I see above selects are not typical ones the OBI EE is intended for but nevertheless I wonder if such kind of reports are possible to do in OBI EE.
Thanks and Regards,
Igor

Similar Messages

  • How can I pass multiple condition in where clause with the join table?

    Hi:
    I need to collect several inputs at run time, and query the record according to the input.
    How can I pass multiple conditions in where clause with the join table?
    Thanks in advance for any help.
    Regards,
    TD

    If you are using SQL-Plus or Reports you can use lexical parameters like:
    SELECT * FROM emp &condition;
    When you run the query it will ask for value of condition and you can enter what every you want. Here is a really fun query:
    SELECT &columns FROM &tables &condition;
    But if you are using Forms. Then you have to change the condition by SET_BLOCK_PROPERTY.
    Best of luck!

  • Where clause in BMM (logical table Source) is not working

    Hello Folks ,
    I felt I ask here before I ask Siebel(oops Oracle!) support, by which I could save significant time NOT restart box multiple times , change log level , upload RPD , making multiple screen shots etc.. etc..
    Here is an example the scenario
    I have a custom field in the activity called the Activity source with two digit abbreviation
    TX – Text message
    LT – Letter
    EM – Email so forth
    The LOV table W_LOV_D has the type as CUST_SRC_ACT
    Whoever implemented analytics they did an alias table for W_LOV_D and did a physical join between W_ACTICITY_F to W_LOV_D through field VAL
    W_ACTICITY_F.X_ACT_SRC--> W_LOV_D.VAL and they did not do a where clause in BMM to retrieve only W_LOV_D.TYPE =’CUST_SRC_ACT’
    So in fact the query pulls TX for CUST_SRC_ACT as well as TX for State abbreviation
    I went ahead and added the where clause filter
    "Siebel Data Warehouse".Catalog.dbo."Dim_W_LOV_D_Acty_Src".TYPE = 'CUST_SRC_ACT'
    I saved the repository and started the server (I was doing offline) spooled the SQL and the results are the same. Looks like the filter is not being applied.
    I did reload the server meta data etc..
    Would anyone knows what is going on with the filter (or what I am doing wrong)?
    Thanks in advance,
    AP

    hi Ap,
    Pull only Dim_W_LOV_D_Acty_Src column into answers and check whether u r able to see CUST_SRC_ACT or not .Of course, you need to check sql query too
    Thanks,
    Saichand.v

  • Where Clause in the Forms doesn't work

    Hi,
    I am trying to execute a query in base table block. The block property 'Query allowed' is TRUE and WHere clause is null;
    I used 'SET_BLOCK_PROPERTY' and set the where clause. Did a GO_BLOCK and EXECUTE_QUERY;
    The block brings all records as if there is no where clause. TO make sure I put up a message 'GET_BLOCK_PROPERTY' to see the where clause. It showed correct where clause.
    null

    Setting the where clause the way you did usually works, and it worked fine for me several times.
    Yet, a couple of days ago I ran into something that defies my logic:
    1) when using the "=" operator, it fetched me several records that satisfied the condition
    2) when using the "<=" or ">=" operator it fetched only one of the records that satisfied the condition: the one that is strictly equal.
    I tried using the pre-query trigger, but to no avail.
    I'm looking forward for your succes.
    null

  • Creating a where clause in the LOV query box

    Hi guys is any able to help me with this one
    i have a page in my app where there is a LOV drop down now the values for this drop down comes from a table that looks like this
    users_for _form_TBL
    E_MAIL
    Vendor
    [email protected]
    oracle
    [email protected]
    sap
    [email protected]
    IBM
    [email protected]
    Oracle
    [email protected]
    intergraph
    So my syntax for the LOV i mentioned looks like this
    select VENDOR as display_value, VENDOR as return_value
      from form_user_tab where E_MAIL = :APP_USER
    order by 1 ;
    so if [email protected] logs onto the app and has to make a selection on the LOV it would only display the vendors relative to his E_MAIL like oracle ,sap, IBM then he hits the submit button on the page then the vendor that he selected is inserted into another table .What i did on the insert table was create a trigger that after a vendor is inserted the trigger inserts a 1 into a column called assessed .
    What i did after this was add a select in the where clause of the LOV so that it would check in the insert table if that vendor had been chosen before and not display it again to be selected  my syntax the second time around in the SQL query box was
    select VENDOR as display_value, VENDOR as return_value
      from users_for _form_TBL where E_MAIL = :APP_USER
    and (select 'vendor' , 'ASSESSD' from inserted _tbl_imp is null);
    order by 1 ;
    But im getting an error any ideas guys .Thank you

    Hay man thanks for that info on the Tom Kyte Blog 
    --(the code you gave me )
    select 
        u.vendor display_value 
      , u.vendor return_value
    from 
        users_for_form_tbl u 
    where 
        u.e_mail = :app_user 
    and not exists (select null from inserted_tbl_imp i where u.vendor = i.vendor) 
    order by 
        u.vendor 
    --(After the error i tried )Then when i got the error i try'd using 'or exists'  like this
    --(code)
    where 
        u.e_mail = :app_user 
    and not exists (select null from inserted_tbl_imp i where u.vendor = i.vendor) 
                          or exists (select null from inserted_tbl_imp i where u.vendor = i.vendor)
    order by 
        u.vendor 
    But the all the vendors that where in the  same in the insert table came up in the drop down list  example is oracle was assessed before then only oracle would appear in the drop down list  and if it was assessed 3 times it would come up 3 times
    --Then i tried to select where 'Assessed' is null   ('Assessed' is a column in the insert table  which i created a trigger on to insert 1 in the 'ASSESSED' column  when a vendor is begin assessed  )  
    --(code)
    where 
        u.e_mail = :app_user 
    and not exists (select 'ASSESSED' from inserted_tbl_imp i where 'ASSESSED' is null ) 
    order by 
        u.vendor 
    This try didnt return any vendors at all
    --Then i tried distinct
    --(code)
    where 
        u.e_mail = :app_user 
    and not exists (select distinct 'VENDOR',  from inserted_tbl_imp i where u.vendor = i.vendor) 
    order by 
        u.vendor 
    This gave me a LOV ERROR
    This is what i have tried so far there where others syntax's i tried last night as well  but most of them came back as errors . Thanks again for you time and help  fac586  

  • Where clause on right side table of a left join

    I was told by someone that a where clause on the right side table of a left join is bad SQL.  I have looked around and found a great article for DB2.  I am not sure if this is 100% correct for SQL Server so would like to find a good detailed
    article on the topic.  
    Thank  you

    I was told by someone that a where clause on the right side table of a left join is bad SQL.  I have looked around and found a great article for DB2.  I am not sure if this is 100% correct for SQL Server so would like to find a good detailed
    article on the topic.  
    Thank  you
    I'm going to be blunt here so if you get offended easily please stop reading now.
    That has got to be some of the dumbest advice I've seen in a while.  Such a query serves a specific purpose, there's no good or bad to it.  Following is a classic example:
    select distinct
    CustomerID
    from Customer as c
    left join Orders as o
    on c.CustomerID = o.CustomerID
    and o.OrderDate > dateadd(day, -90, getdate())
    where o.CustomerID is null
    The above hypothetical query, which includes a where clause which targets the right table in a left join, returns all customers which have not placed an order in the past 90 days.  It's a perfectly valid query which serves a key business purpose and
    I challenge anyone to justify why they claim it is "bad SQL".
    Such a query will execute efficiently given appropriate indices.  There's simply no justification for such a blanket statement about where clauses and outer joins.

  • Boolean variable in where clause

    Hello,
    Does anyone know if it possible to include
    BOOLEAN variable in where clause as following:
    is_in_group BOOLEAN;
    begin
    is_in_group :=
    portal30.wwsec_api.is_user_in_group (
    p_person_id => portal30.wwctx_api.get_user_id,
    p_group_id => portal30.wwsec_api.group_id('GROUPNAME')
    for x in(select start_time,title
    from ec_reservations
    where
    start_time >= '2004-JAN-01'
    and rv_target_type='PU'
    and is_in_group = true
    Thank You,
    Helena

    Well, let's try it, eh?
    SQL> conn scott/tiger
    Connected.
    SQL> CREATE OR REPLACE FUNCTION sal_test ( p_sal IN NUMBER) RETURN BOOLEAN IS
      2  BEGIN
      3     RETURN p_sal > 1500;
      4  END;
      5  /
    Function created.
    SQL> SELECT ename, sal
      2  FROM   emp
      3  WHERE  sal_test(sal) = TRUE;
    WHERE  sal_test(sal) = TRUE
    ERROR at line 3:
    ORA-00904: "TRUE": invalid identifier
    SQL> So this is what we find. BOOLEAN is not a vlid SQL datatype, at least for Oracle. This is a source of much wailing and gnashing ot teeth. I believe there are enhancement requests for it, but no signs on the horizon.
    In the example you give you need it. You would be better off doing this...
    is_in_group BOOLEAN;
    begin
    is_in_group :=
    portal30.wwsec_api.is_user_in_group (
    p_person_id => portal30.wwctx_api.get_user_id,
    p_group_id => portal30.wwsec_api.group_id('GROUPNAME')
    IF is_in_group = true THEN
       FOR  x IN (select start_time,title
                  from ec_reservations
                  where start_time >= '2004-JAN-01'
                  and rv_target_type='PU' )
       ...Otherwise you have to recast your function so it returns VARCHAR2 with values of 'TRUE' and 'FALSE' (or NUMBER returning 0 and 1, whatever).
    Cheers, APC

  • [38133] The Logical Table [...] is not joined to any other logical table.

    Hi all!
    I'm very new to Oracle BI EE. My need is to create my first report in BI. I've opened Oracle BI Administration Tool, created new repository, added physical tables, created new item named "reports" in "Business Model and Mapping" section, made "drug-n-drop" my physical tables into new item. Now when I run "check consistency" on "reports" item it returns errors:
    Business Model reports:
    [38133] The Logical Table '"reports"."table1"' is not joined to any other logical table.
    [38133] The Logical Table '"reports"."table2"' is not joined to any other logical table.
    [38133] The Logical Table '"reports"."table3"' is not joined to any other logical table.Could you please help me with these errors?
    Oracle Business Intelligence 11.1.1.6.0

    Looks like you drag-n-drop each table, try to all at once with that all physical layer joins are come and treated as logical joins. Other wise try to create them manually.
    drag-n-drop always is not possible so we have to go for manually.
    If this is not in your case let me know else pls mark as correct/helpful

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • Handling Outer Join for hard coded values in the Logical Table Source

    Has anyone tried to apply an outer join in the Logical Table Source Content Tab?
    I have to add this APPLSYS.FND_LOOKUP_VALUES.LANGUAGE (+)= 'US' but the outer join is not allowed. I get this message.... [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] .
    Could you tell me please how this should be handled? I have a lot of this cases in my project and without this being set-up affects the expected output of my report.
    Thank you in advance.

    hi Ap,
    Pull only Dim_W_LOV_D_Acty_Src column into answers and check whether u r able to see CUST_SRC_ACT or not .Of course, you need to check sql query too
    Thanks,
    Saichand.v

  • Improve the performance in stored procedure using sql server 2008 - esp where clause in very big table - Urgent

    Hi,
    I am looking for inputs in tuning stored procedure using sql server 2008. l am new to performance tuning in sql,plsql and oracle. currently facing issue in stored procedure - need to increase the performance by code optmization/filtering the records using where clause in larger table., the requirement is Stored procedure generate Audit Report which is accessed by approx. 10 Admin Users typically 2-3 times a day by each Admin users.
    It has got CTE ( common table expression ) which is referred 2  time within SP. This CTE is very big and fetches records from several tables without where clause. This causes several records to be fetched from DB and then needed processing. This stored procedure is running in pre prod server which has 6gb of memory and built on virtual server and the same proc ran good in prod server which has 64gb of ram with physical server (40sec). and the execution time in pre prod is 1min 9seconds which needs to be reduced upto 10secs or so will be the solution. and also the exec time differs from time to time. sometimes it is 50sec and sometimes 1min 9seconds..
    Pl provide what is the best option/practise to use where clause to filter the records and tool to be used to tune the procedure like execution plan, sql profiler?? I am using toad for sqlserver 5.7. Here I see execution plan tab available while running the SP. but when i run it throws an error. Pl help and provide inputs.
    Thanks,
    Viji

    You've asked a SQL Server question in an Oracle forum.  I'm expecting that this will get locked momentarily when a moderator drops by.
    Microsoft has its own forums for SQL Server, you'll have more luck over there.  When you do go there, however, you'll almost certainly get more help if you can pare down the problem (or at least better explain what your code is doing).  Very few people want to read hundreds of lines of code, guess what's it's supposed to do, guess what is slow, and then guess at how to improve things.  Posting query plans, the results of profiling, cutting out any code that is unnecessary to the performance problem, etc. will get you much better answers.
    Justin

  • How can we use  form variable in where clause while personalization

    Dear,
    I have a requirment for using select in personalization, actully we have created temporary table, now we want to get data from select satatement on event"when-new-record-instance' trigger, now in action tab i have selected action which is property and message, in message column showing value "${item.q_res.transaction_id.value}" it shows on validate button but when this form variable use in action type(property) which is consist on select statement "=SELECT to_char(QTY) FROM TEST_TABLE where transaction_id = ${item.q_res.transaction_id.value}" system didn't get value pressing validate button although there is a single record in customize table while without where cluase was getting data perfectly.
    please advice.

    >
    I am looking for to decode the actual db value something in different for my report.
    like if A then Accepted
    elseif R then Rejected
    elseif D then Denied
    these conditions I have to check in where clause.
    >
    what are you trying to do?
    may be you are looking for
    select * from tab1,tab2
    where a.tab1 = b.tab2
    and
       (decode(:code, 'A','Accepted') = <table_column>
        or
        decode(:code, 'R','Rejected') = <table_column>
       or
        decode(:code, 'D','Denied') = <table_column>
       )

  • How to pass the parameter in the where clause of the select statement

    Hi All,
    Iam getting one of the value from the Input otd and using this value i need to query one of the tables in oracle database and selected the table using the oracle eway otd like shown below .
    otdRISKBLOCK_1.getRISKBLOCK().select() .
    where clause in side the select takes a string parameter as Iam getting the string parameter from the input otd and passing this to where clause by creating a string literal after deployment it is giving an error saying "ORA-00920: invalid relational operator".
    can any one throw some input on this .
    Thanks in Advance
    Srikanth

    You will see this error if the search condition was entered with an invalid or missing relational operator.
    You need to include a valid relational operator such as
      =, !=, ^=, <>, >, <, >=, <=, ALL, ANY, [NOT] BETWEEN, EXISTS, [NOT] IN, IS [NOT] NULL, or [NOT] LIKE in the condition. in the sql statement.
    Can you throw some more light on how are you designing your project?

  • Counting number of records using where clause in a large table

    SQL SERVER 2008
    I've to find the count of the rows matching some conditions. The table size is very large with around 50 columns. And every day around 3000 rows are adding. 
    My business logic is to count the number of payments made by a particular user, also if the count exceeds 10 then the user is GoldUser else NormalUser.
    here:
    select count(payment_id) from payments_master_table where payment_user = @payment_user;
    here payment_id is primary key. This query is very slow, since it has to scan the whole table. Is there any other optimized way to find the number of counts. 
    Also, one way I can do is, if the count of payment_id exceeds 10, stop the count,
    but I do not how to do this.  
    Please can anyone help me. 
    Thanks!

    not top 10, but suppose 
    if the count(payment_id) reached 10 for a particular user before scanning the whole
    table, why to proceed ahead. My condition is to apply any user as GoldUser if the count is 10 or more than that. So stop the count if it reaches 10.
    Then in that case you need to implement it as a correlated query
    ie like
    SELECT t.User,COUNT(*)
    FROM table t
    CROSS APPLY (SELECT TOP 10 payment_id
    FROM table
    WHERE payment_user = t.payment_user
    )t1
    GROUP BY t.User
    It will try to fetch random 10 rows for the user and then get count. But even in this case you cant tell it will stop at exactly 10 record for every user as it depends on few other factors too.
    In any case the index on the payment_user column will really help
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Outer join with where clause in the universe

    Hi,
    I have two tables such as:
    Patient Table (P)                          Territory Table (T)
    P. Alignment ID --------------------------   T.Alignment ID
    P. Patient ID                                    T. Region
    Two tables are joined on alignment ID, follow is how the data looks like
    When i run the query only on Patient Table  i get the following
    e.g.
    Select P.Patient ID, P.Alignment ID
    from Patient Table (P)
    Where P.Data_date=P.Latest data date
    ----Note that there is a Where clause here always & i get the following result
    P.Patient ID         P.Alignment ID      
        1                            1a
        2                             2a
        3                            3a
        4                            Null
        5                            Null
    Now when i join two tables on Alignment ID
    e.g.
    Select P.Patient ID, P.Alignment ID,T.Region
    from Patient Table (P)
    LEFT OUTER  JOIN Territory Table (T)
    ON P. Alignment ID =  T.Alignment ID
    Where P.Data_date=P.Latest data date
    AND T.Data_date=T.Latest data date
    Following is the result:
    P.Patient ID         P.Alignment ID      
        1                            1a
        2                            2a
        3                            3a
    Even with the left outer join it is not brining in the Null values , it seems that because of the WHERE clause the LEFT OUTER is working as a INNER join.
    How can i get the Null rows with my join to the territory table ?
    Please Advise,
    Thanks,
    Sheikh

    its not letting me atatched the excel extract but the data is simple as i shown above e.g.
    Patient Table (P)                          Territory Table (T)
    P. Alignment ID --------------------------   T.Alignment ID
    P. Patient ID                                    T. Region
    Two tables are joined on alignment ID, follow is how the data looks like
    When i run the query only on Patient Table  i get the following
    e.g.
    Select P.Patient ID, P.Alignment ID
    from Patient Table (P)
    Where P.Data_date='01-OCT-2014'
    ----Note that there is a Where clause here always & i get the following result
    P.Patient ID         P.Alignment ID      
        1                            1a
        2                             2a
        3                            3a
        4                            Null
        5                            Null
    Now when i join two tables on Alignment ID
    e.g.
    Select P.Patient ID, P.Alignment ID,T.Region
    from Patient Table (P)
    LEFT OUTER  JOIN Territory Table (T)
    ON P. Alignment ID =  T.Alignment ID
    Where P.Data_date='01-OCT-2014'
    AND T.Data_date='01-OCT-2014'
    Following is the result:
    P.Patient ID         P.Alignment ID      
        1                            1a
        2                            2a
        3                            3a
    Now the whole issue is that the condition in the WHERE clause is making it act like a inner join and iw ant the NULL rows to appear
    Sheikh

Maybe you are looking for