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  

Similar Messages

  • How do I modify the WHERE clause in my SQL query?

    This seems like such a straight-forward part of the report design, but I'm fairly new to Crystal Reports and I only have experience with modifying reports someone else has already written.  In this particular case, I just need to modify the WHERE clause of the SQL query.  I can select Show SQL Query and see what statement is being used to select data, but I can't find where to modify it since it's grayed out.  I see how to change the selection criteria, parameters, grouping, etc...just not the WHERE clause.  The report is linked to a database used for reporting with a table created and populated by a stored procedure.  I don't need to modify the stored procedure because the data I want to filter by is currently in the table--I just don't know how to filter by what I need.  Here's part of the query:
    SELECT "rpt_dist"."startdate", "rpt_dist"."transtype", "rpt_dist"."laborcode", "rpt_dist"."crewid", "rpt_dist"."regularhrs" FROM   "Reporting"."dbo"."rpt_dist" "rpt_dist"
    WHERE  (rpt_dist."transtype" <> 'WORK' AND rpt_dist."transtype" <> 'WMATL') AND rpt_dist."laborcode" LIKE 'S%' AND (rpt_dist."crewid" = 'HOUS' OR rpt_dist."crewid" = 'HOUS2' ...
    I would like to add another crewid to the WHERE clause.  Thanks for any input.

    1.Open the report in the crystal designer
    2.Go to the field explorer(if hidden go to view menu->field explorer)
    3.Rt. click on the database fields->choose database expert
    4.Now you will see 2 columns-Available DataSource  and Selected Tables
    5.Rt. click on the object(ex.command) available in the Selected Tables column->Choose Edit command
    6.A new Modify Command window will appear,here you can edit your SQL Query
    I get to step 4 and I see the two columns including my database and the report table, but there is no command object available.  If I right-click on my table, I can just view the Properties. ??
    As for the other tip to modify the record selection:  I don't see anywhere the other crewid values are set and if I add the one I'm missing, it doesn't modify the existing SQL Query and when I preview the report it throws off the results so that no data displays??
    I'm using Crystal Reports 11.5 if that makes a difference.  Thanks again.

  • How to dynamically update columns in a where clause to a SQL query in OSB?

    Hi Gurus,
    I have a requirement where in we need to dynamically update a where clause to a SQL query in OSB(11.1.1.6.0).
    For example:
    If the JCA sql string is "select * from emp where emp_id = 100 and emp_status ='Permanent'" now i want to change this where clause and the new query has to be like "select * from emp where emp_name like 'S%' and emp_dept like 'IT' ". basically we need to change the where clause dynamically.
    We can also use "fn-bea:execute-sql()" in a xquery but I don't want to use this function as creates a new connection.
    I have done some home work and found out --> as per the DOC "http://docs.oracle.com/cd/E23943_01/dev.1111/e15866/jca.htm#OSBDV943" section: "25.5.2 JCA Transport Configuration for Proxy and Business Services", when a business service is created by using JCA, we can see Interaction Spec Properties under JCA Transport Tab. This will have a property "SqlString' and we can over ride it. But I am unable to figure out how to over ride the value. I have tried by using Transport Headers activity but no luck. Please guide me how to achieve this?
    Thanks in advance
    Surya

    I solved my problem.
    In my header renderer, I simply added a line to set the text to the object value "label.setText( (String) value );" (where label is an instance of a JLabel.
    Thank you to who took some time to think about it.
    Marc

  • How to change the lov query??

    Hi Friends,
    I am trying to extend a controller of the base page to change the lov query. I am not able to get the lov VO since I am not getting the lov AM in the controller.
    I want to use the setQuery() to set the lov query programatically in base class controller PR.
    My controller code looks like ::
    OAApplicationModule am = oapagecontext.getRootApplicationModule();
    oapagecontext.writeDiagnostics(this,"The Root AM is : " + am.toString(),6); // displaying oracle.apps.icx.por.req.server.RequisitionAMImpl
    OAApplicationModule lovAM = (OAApplicationModule)am.findApplicationModule("RequisitionLovAM"); // Returning Null
    OAViewObjectImpl vo = (OAViewObjectImpl)lovAM.findViewObject("ReqSupplierVO");
    String seededQuery = vo.getQuery();
    oapagecontext.writeDiagnostics(this,"Seeded Query for ReqSupplierVO is "+ seededQuery,6);
    String customQuery = "new_query" // here i m writing my new query.
    vo.setQuery(customQuery); // setting my custom query.
    oapagecontext.writeDiagnostics(this,"Custom Query for the ReqSupplierVO is "+ vo.getQuery(),6);
    The following are the details.
    Base Page : /oracle/apps/icx/icatalog/shopping/webui/NonCatalogRequestPG
    Base Page Controller : logi.oracle.apps.icx.icatalog.shopping.webui.NonCatalogRequestCO
    Lov Region : /oracle/apps/icx/lov/webui/ReqSupplierLovRN
    Lov Controller : oracle.apps.icx.lov.webui.ReqSupplierLovCO
    Lov VO : oracle.apps.icx.lov.server.ReqSupplierVO ( i want to remove outer join in this VO query )
    I cant extend the lov controller since the same lov region is using in other pages also where i dont want apply my new lov query.
    Is the way i am trying is correct? How can i get the Lov AM in the base page? Any help highly appreciated.

    Hi Pratap,
    Thanks for coming back on this.
    The background of this customization is, We are implementing AME and are trying to restrict the number of approvers in the Change First Approver LOV (ApprroverLovVO.xml) based on company code and cost centre during the creation of Requistion. At the moment, the LOV is bringing back every employee who has a valid WF role.
    At the moment (up till I saw this thread) I was trying to customize ReqApprChfCo.java by adding this code to processRequest method
    OAMessageLovInputBean CompanyCode = (OAMessageLovInputBean)oawebbean.findIndexedChildRecursive("ChargeAccountFlex0_column"); //this is returing null
    OAMessageLovInputBean CostCentre = (OAMessageLovInputBean)oawebbean.findIndexedChildRecursive("ChargeAccountFlex1_column"); //this is returing null
    RequisitionLovAMImpl am = (RequisitionLovAMImpl)oapagecontext.getApplicationModule(oawebbean); // this is returning null
    OAViewObject approverLovVO = (OAViewObject)oam.findViewObject("ApproverLovVO");
    Then, once found to append the viewobject with where clause. Was this the right method of achiving it, or to create a new custom VO and region?
    Regards,
    Chetan

  • How to create dynamic where clause instead of pragmatically

    Hi,
    I'm using Jdev 11.1.2.2.0 and my requirement to create a two fields with search button to fetch data as adf table. User need to enter either of the field value and click search button to see his data.
    So I created a sql query based view object with 2 bind variables (which are input params) & 2 view criteria (to create dynamically where clause) and then drag on to the page by ExecuteWithParams operation from data controls but couldnt work.
    If anyone have idea to build dynamically please let me know.
    Amar

    User need to enter either of the field value and click search button to see his data.User need to enter either of the field value and click search button to see his data.
    Hi Amar,
    Is your requirement, creating a query panel with table??
    Drag and drop the view criteria(Application Navigator>DataControls> AppModule >NamedCriteria> ViewCriteriaName ) onto the page.
    In the context menu, select Query->ADFQueryPanel With Table.. That brings your necessary two columns and Search field with data represented as a table.
    Harsha
    Edited by: Harsha049 on Nov 28, 2012 3:51 PM

  • 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 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

  • 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

  • While creating a PO in ME21N the return check box is automatically ticked.

    Hi SAP Gurus,
    I am facing a problem while creating a PO.
    Every time I am trying to create a PO in ME21N, the return check box at the Item level of the PO is automatically getting ticked.
    The check box can't be unticked even in change mode of the PO.
    So all of the PO's with different document types are getting created with the Return check box ticked.
    Can you help me to uncheck the Return tab in the Item level.
    Please advice if any configuration is required or the code has to be modified.
    Thanks in adavance.
    Regards
    Subhasis

    Hi,
    Go to the Table T007A, where you find the tax codes.
    Input & out put taxes are the tax types.
    In FTXP T.code give the tax code and  click on the
    Input tax codes are used for purchase cycle and out put taxes are for sales cycle. I Hope you have given the sales related tax code. Thats why system is giving the error message.
       In T007 Table give the proper input and get the details.
    Regards,

  • Performance hit using "where" clause in the query

    Hi All,
    I am facing a huge performance hit in the java code when using "where" clause in queries. Following are the details:
    1. SELECT * FROM Employee
    2. SELECT * FROM Employee where employeeid in (26,200,330,571,618,945)
    There is no difference in Query Execution Time for both queries.
    Business Logic Time is huge in second case as compared to first one (ratio - 1:20).
    Rows returned are more in first case as compared to second case.(ratio - 1:4)
    Business Logic is same for both the cases where I iterate through the ResultSet, get the objects and set them in a data structure.
    Does anybody know the reason of unexpected time difference for the business logic in the second case?

    Since you're mentioning clustering your index, I'll assume you are using Oracle. Knowing what database you are using makes it a lot easier to suggest things.
    Since you are using Oracle, you can get the database to tell you what execution plan it is using for each of the 2 SQL statements, and figure out why they have similar times (if they do).
    First, you need to be able to run SQL*Plus; that comes as part of a standard database installation and as part of the Oracle client installation - getting it set up and running is outside the scope of this forum.
    Second, you may need your DBA to enable autotracing, if it's not already:
    http://asktom.oracle.com/~tkyte/article1/autotrace.html
    http://www.samoratech.com/tips/swenableautotrace.htm
    Once it's all set up, you can log in to your database using sql*plus, issue "SET AUTOTRACE ON", issue queries and get execution plan information back.
    For example:
    SQL> set autotrace on
    SQL> select count(*) from it.ticket where ticket_number between 10 and 20;
      COUNT(*)
            11
    Execution Plan
    Plan hash value: 2983758974
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            |     1 |     4 |     1   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE   |            |     1 |     4 |            |          |
    |*  2 |   INDEX RANGE SCAN| TICKET_N10 |    12 |    48 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("TICKET_NUMBER">=10 AND "TICKET_NUMBER"<=20)
    Statistics
              0  recursive calls
              0  db block gets
              1  consistent gets
              0  physical reads
              0  redo size
            515  bytes sent via SQL*Net to client
            469  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> This tells me that this query used an INDEX RANGE SCAN on index TICKET_N1; the query can't do much better than that logically... In fact, the statistic "1 consistent gets" tells me that Oracle had to examine only one data block to get the answer, also can't do better than that. the statistic, "0 physical reads" tells me that the 1 data block used was already cached in Oracle's memory.
    the above is from Oracle 10g; autotrace is available back to at least 8i, but they've been adding information to the output with each release.
    If you have questions about sql_plus, check the forums at asktom.oracle.com or http://forums.oracle.com/forums/category.jspa?categoryID=18
    since sql*plus is not a JDBC thing...
    Oh, and sql*plus can also give you easier access to timing information, with "set timing on".

  • Where-clause with the in-keyword. Query optimising.

    Hi I have following question.
    I have a query, e. g.
    select x, y from tableA where y in (a_1, a_2, ..., a_n)
    I have test it with n=1...5
    1. 5-6 ms
    2. 5-6 ms
    3. 150 - 200 ms
    4. 150 - 200 ms
    5. 180 - 250 ms
    There is a gap between n = 2 and n = 3. According to the execution plan the Oracle make a full table access if n >= 3. If n < 3 a an index is used. Is it possible to ensure that the index is always used?
    Additionally I have test the equivalent query:
    select x, y from tableA where y = a_1 or y = a_2 ... < = a_n
    It showsthe same behaviour.

    Hi,
    I wouldn't say that the optimizer is wrong here. I would look on some more imputs.
    How many values of y do you have in the table?
    please post the result of:
    select count(*),y
    from tablea
    group by y;
    to see how many values of each y-value exists in the table.
    For example, if there are only values 1..5 for y in the table a full table scan is the fastet answer for your query, because all values have to read!
    Regards
    Udo

  • OPEN CURSOR using a WITH clause in the select query

    Hi,
    I am using Oracle 9i. I have a requirement where I have a REFCURSOR as an OUT parameter for my procedure. I have declared the TYPE and created the procedure.
    In the procedure, I am using OPEN <cursor_name> FOR <query>;
    Ideally this works in most of the cases that I have tried earlier. However, in the current case I am using a WITH clause in my query to get the results.
    I need help in understanding if the above mentioned syntax would not allow me to use the WITH clause in the query.

    What error do you get , seems to work ok for me on 10g
    SQL> begin
      2  open :cv for 'with x as (select * from emp)  select * from x';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> print :cv
         EMPNO
    ENAME
    JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7521
    WARD
    SALESMAN        7698 22-FEB-81       1250        500         30
          7566
    JONES
    MANAGER         7839 02-APR-81       2975                    20
         EMPNO

  • 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?

  • Using bind variable in dynamic where clause and concatenate with query

    Hi,
    In my procedure i am framing where clause dynamically with bind variable,When i am concatenate this with my sql query for REF CURSOR i got sql command not properly ended exception.
    Is it possible to pass values to the bind variable through the dynamic variable/value?
    Please advise
    Thanks in advance
    Siva
    IF in_applicationId IS NOT NULL THEN
              optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
         END IF;
    My query is like this
    open Out_Main FOR SelectQuery USING optional_using

    Thanks for reply,
    In my procedure, i suppose to frame the where clause with bind dynamically according to the input parameters. so that i am framing the values of the bind variables also dynamically like this,
    Please advise...
    IF in_assignedAppFlag IS NOT NULL THEN
              IF in_assignedAppFlag = 'Y' THEN
                   optional_where := optional_where || ' AND b.ASSIGNED_TO = :b' ;
              optional_using := ' in_appFuncGroup'||',in_currentUserID';          
              ELSe
                   IF in_isSupervisor = 0 THEN
                        optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID';
                   END IF;
              END IF;
         ELSE
              IF in_isSupervisor = 0 THEN
                   optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
                   optional_using := ' in_appFuncGroup'||',in_currentUserID';
              END IF;
         END IF;
         IF in_appFuncGroup IS NOT NULL THEN
              optional_where := optional_where || ' AND e.APP_FUNC_GROUP= :c';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup';
         END IF;
         IF in_queue_id IS NOT NULL THEN
              optional_where := optional_where || ' AND b.QUEUE_ID = :d';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id';
         END IF;
         IF in_applicationId IS NOT NULL THEN
              optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
         END IF;
         IF in_sourceCode IS NOT NULL THEN
              optional_where := optional_where || ' AND e.APP_SOURCE_CODE like '||':f%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode';
         END IF;
         IF in_logo IS NOT NULL THEN
              optional_where := optional_where || ' AND appProds.PRODUCT_TYPE like '||':g%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo';
         END IF;
         IF in_firstName IS NOT NULL THEN
              optional_where := optional_where || ' AND upper(a.FIRST_NAME) like upper(:h%)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName';
         END IF;
         IF in_surName IS NOT NULL THEN
              optional_where := optional_where || ' AND upper(a.SURNAME) like upper(:i%)';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName';
         END IF;
         IF in_retreival_id IS NOT NULL THEN
              optional_where := optional_where || ' AND e.RETREIVAL_ID like :j%';
              optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
              ||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName'||',in_retreival_id';
         END IF;

  • Multiple values in where clause(IN) of select query in Cisco Cloud Portal using single field

    I can actually pass multiple values in the IN statement of select query using multiple dictionary fields in the data retrieval rule of the AFC in Cisco cloud portal like
    #dictionary.field1# = 1 and
    #dictionary.field2#=2
    select col1,col2 from table1 where col3 in (#dictionary.field1#,dictionary.field2#).
    but I want to pass mutiple values in a single field as
    #dictionary.field1#=1,2
    select col1,col2 from table1 where col3 in (#dictionary.field1#) and the query gives no data because it is taking as '1,2' instead of '1','2'.
    Please give the solution for passing multiple values in a single variable to use in IN operator of WHERE clause

    Ok, I now understand what you are trying to do. Unfortunately, you cannot inject parts of a SQL statement into a DDR through a dictionary field, which always represents a specific value (the comma in your case is attempting injection of a SQL construct to refer to multiple values). One possible solution is to arbitrarily consolidate your list of values using a delimiter that you know will not be in the values themselves such as a colon (:). Let's use 3 values as it serves as a better example.
    Set your dictionary field to a single reference to all 3 values of interest, say 'a', 'b', 'c' as:
    :a:b:c:  (you can use javascript to create this consolidated dictionary field)
    Now your query would look something like the following:
    select col1,col2 from table1 where #dictionary.field1t# like '%:'+col3+':%'
    This should achieve the desired result.

Maybe you are looking for

  • Select-endselect

    WHY WE DONOT USE SELECT-ENDSELECT. IF I WILL USE SELECT-END SELECT STATEMENT IN REPORT. I KNOW PEEFORMANCE OF THE REPORT WILL BE SLOW. COULD U PLESE TELL ME THE OTHER REASON

  • IPod shuffle  recognized by iTunes but can't get downloaded audio courses into iTunes and onto shuffle.

    When iPod shuffle is plugged in and I go to Computer, it doesn't always show up, so maybe there is a loose connection. I jiggle it and try different things and it shows up temporarily then goes again. But the biggest problem is that I get a message s

  • Assigning partner procedure

    Hello , I like to confirm that a partner procedure defined for a sales doc type Must not be assigned to an account group and a partner procedure for customer master Must Only be assigned to an Account group. Else the configuration will not get expect

  • Changing pdf templates

    i have several hundered PDFs that I need to update the copyright information on as well as add our updated company logo. I only have the PDFs, none of the original source files (Word or InDesign). Ideally i would just be able to run a batch process t

  • Adding Glossary items from chapter text.

    Adding Glossary items one by one is painful. Any short cut you can suggest to create them? Thanks.