OA Framework LOV – How to add where clause dynamically at runtime

Hi All,
Following is my page design:
MainAM (This is root Application module) Package is: mycompany.oracle.apps.<product>.<project>.server
MainPageVO (This is the View Object associated to Main AM)
LovAM (This Application module is for LOVs) Package is: mycompany.oracle.apps.<product>.<project>.lov.server
FileNameLovVO (This is the View Object is for "File Name" LOV. It is associated LovAM)
I my main page is attached to the "Main AM". In the main page, I have a custom search region and in that there is a messageLovInput type of field based on "FileNameLovVO". The field name is File Name.
Use Case:
When a user opens the page, I determine user type. If the use is a clerk (not a superuser) then I need to restrict values in my File Name LOV by setting where clause dynamically.
Issue1:
====
In the main page controller when I do following, OA Framework is not able to access the "FileNameLovVo".
1. Following code is from the main page's controller:
String userId = 100;
LovAMImpl lovAm = new LovAMImpl();
Serializable[] lovParameters = {userId};
Class[] lovParamTypes = { String.class };
lovAm.invokeMethod("initLovQuery", lovParameters, lovParamTypes);
2. In LovAMImpl class I have created following method:
public void initLovQuery(String useId)
FileNameLovVOImpl fileNameLovVo = getFileNameLovVO1(); // ******This returns NULL*******
if (fileNameLovVo == null)
MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "getFileNameLovVO1")};
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
fileNameLovVo.initQuery(userId);
In the above code "FileNameLovVOImpl fileNameLovVo = getFileNameLovVO1();" is returning NULL.
Please let me know what am I missing here.
I resolved above issue with following work around:
1. Attached "FileNameLovVO" to "MainAM"
2. Moved initLovQuery(String useId) method to "MainAMImpl" class.
Is that the correct way? I would prefer NOT to attach "FileNameLovVO" to "MainAM". Any suggestions?
Issue2:
====
After using above work around I tried to set WHERE clause dynamically:
FileNameLovVO is based on following SQL query:
SELECT DISTINCT file_name FROM <table> WHERE USER_ID like :1
I need to pass value for USER_ID if the user is a clerk and I need to pass '%' if the user is a supper user. I'm passing value in "LovVo.initQuery(userId)" method using following code:
public void initQuery(String userId)
StringBuffer whereClause = new StringBuffer(1000);
Vector parameters = new Vector(1);
int bindCount = 0;
setWhereClauseParams(null);
if ((userId != null) && (!("".equals(userId.trim()))))
parameters.addElement(servicerId);
whereClause.append(++bindCount);
if (bindCount > 0)
Object[] params = new Object[bindCount];
parameters.copyInto(params);
setWhereClauseParams(params);
executeQuery();
When I select LOV at runtime in the page, it fails with following error:
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT DISTINCT file_name FROM <table> WHERE user_id LIKE :1) QRSLT WHERE (( UPPER(FILE_NAME) like :1 AND (FILE_NAME like :2 OR FILE_NAME like :3 OR FILE_NAME like :4 OR FILE_NAME like :5))) ORDER BY file_name desc
OA Framework tries to create following statement:
SELECT *
FROM (SELECT DISTINCT file_name
FROM <table>
WHERE user_id LIKE :1) qrslt
WHERE (( UPPER (file_name) LIKE :1
AND ( file_name LIKE :2
OR file_name LIKE :3
OR file_name LIKE :4
OR file_name LIKE :5
ORDER BY file_name DESC
Any help is greatly appreciated.
Thanks for your help guys.
Mitesh

I have a lovinput item which has an external LOV attached to it - the VO uses the below sql query. I want to display the addresses of the customer accounts belonging to the customer name or account entered. I have a PPR event in the account number field which is calling the onAccountNumber method in my AM - the method is getting triggered when you enter the account number and the vo returns the rowcount as 3 exactly but if you click the lovinput item - it brings back all the addresses available instead bringing back addresses beloning to the account number.
public void OnAccountNumber(String accountNumber,String partyName,
Boolean executeQuery)
System.out.println("Im here on account number" + accountNumber + " PartyName:" + partyName);
AddressVOImpl Addrvo= getAddressVO1();
Vector parameters = new Vector(2);
StringBuffer whereClause = new StringBuffer(100);
int clauseCount = 0;
int bindCount = 0;
Addrvo.setWhereClauseParams(null); // Always reset
if ((accountNumber != null) && (!("".equals(accountNumber.trim()))))
whereClause.append(" Account_Number = :");
whereClause.append(++bindCount);
parameters.addElement(accountNumber);
clauseCount++;
if ((partyName != null) && (!("".equals(partyName.trim()))))
if (clauseCount >0){
whereClause.append(" AND ");
whereClause.append(" Party_Name like :");
whereClause.append(++bindCount);
parameters.addElement(partyName);
clauseCount++;
Addrvo.setWhereClause(whereClause.toString());
if (bindCount >0)
Object[] params=new Object[bindCount];
parameters.copyInto(params);
Addrvo.setWhereClauseParams(params);
System.out.println("AddressVO:" + Addrvo.getQuery() );
//Addrvo.executeQuery();
System.out.println("Addr Cnt:" + Addrvo.getRowCount());
SQL used in VO
=========
SELECT hl.address1
|| ' '
|| hl.address2
|| ' '
|| hl.address3
|| ' '
|| hl.city
|| ' '
|| hl.postal_code
|| ' '
|| hl.state
|| ' '
|| hl.country address,
hca.account_number,hp.party_name
FROM hz_cust_accounts hca,
hz_cust_site_uses_all hcsu,
hz_cust_acct_sites_all hcs,
hz_party_sites hps,
hz_locations hl,
hz_parties hp
WHERE hcsu.cust_acct_site_id = hcs.cust_acct_site_id
AND hcs.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hca.cust_account_id = hcs.cust_account_id
AND hcsu.site_use_code = 'SHIP_TO'
AND hcsu.status = 'A'
AND hp.party_id = hps.party_id
AND hp.party_id = hca.party_id
-- AND account_number=6028
Can someone please tell me how to restrict the addresses lov to an entered account number or customer name??

Similar Messages

  • How to add where clause in LOV..?

    hi
    I want to set the value dynamicaaly to the LOV VO.
    But i am getting errors like
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    Invalid column type
    Please Help me on this?

    hi Braj
    thanx for reply..
    this is the error message
    Logout
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT organization_id,name
    FROM hr_organization_units
    where COST_ALLOCATION_KEYFLEX_ID in
    (SELECT pcak.COST_ALLOCATION_KEYFLEX_ID FROM pay_cost_allocation_keyflex pcak WHERE pcak.segment2 like :1)
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:71)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1566)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2996)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3043)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:860)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:669)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3723)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:743)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:892)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:806)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:800)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3643)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processFormRequestAfterController(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAListOfValuesBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:71)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1566)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2996)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3043)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:860)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:669)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3723)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:743)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:892)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:806)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:800)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3643)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processFormRequestAfterController(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAListOfValuesHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAListOfValuesBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:71)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • 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

  • How to add a frame dynamically in a jsp page.

    Hai all,
    In my application, in a particular jsp page i had the 3 links namely add.edit and delete. When click on add button, it is pointing to another jsp page where i can enter user details. But what i want now is when i click add button, the form in which we fill the user details should be added to the current page itself dynamically i.e., it should not go to another page when i click add button and that form should be displayed in the current page in a new frame dynamically.
    The same should happen when i click n edit or delete options. everything should be diaplayed in the same page in different frames.
    Can anyone suggest me about how to add a frame dynamically.

    You create a frameset with two frames. One frame you give 100% of the rows and run the JSP in this frame. The other frame you give 0% of the row so that it is hidden. In the JSP you use a JavaScript funtion to submit the form. This function will call the parent frameset to reset the row values to 50%/50% which will make the bottom frame visible and then submit the form request with the bottom frame as teh target.
    It is not so much as creating frames as using JavaScript to hide and display frames.

  • How to add ComboBox to dynamically created DataGridColumn ?

    hai friends,
    help me, How to add ComboBox to dynamically created DataGridColumn

    public     function docfoldercurtainmanagerResult(event):void
    if(event.result){
    rightslistArray=event.result.RES2;
    //Alert.show(event.fault.message);
    <mx:DataGridColumn  
    headerText="Rights Level" minWidth="75" sortable="true" >
    <mx:itemRenderer>
    <fx:Component>
    <mx:ComboBox dataProvider="{outerDocument.rightslistArray}" labelField="sec_rights_level" />
    </fx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>

  • How to use where clause with get statement in LDB programs

    Hi All,
    I am using logical databse in my report program.I am not getting how to use the where clause in the get statement is it possible to use?or if not possible only option is we should filter it after get statment is right?Can you please some body throw some idea on this?
    Regards
    Mahesh

    Hi,
    Reffer these links
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
    /people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
    reward if helpful
    Thanks,
    Suma.

  • How to use WHERE Clause in BPEL

    Hi ,
    i am trying to use where clause in DB adapter but its not working.
    my query is "select empname from employee where empid = &a"
    can any body tell me what is the reason its npt working?
    and how can i retrive data form DB?

    Hi,
    You are thinking perfectly fine. The solution what I suggested was
    select ename from emp where empno=?
    And the solution provided by you was
    SELECT first_name, last_name FROM per_all_people_f WHERE person_id = #p_person_id
    There is no problem with the above mentioned select statements.
    I just want to say that if you see closely, internal logic changes #parameter name to ?. So both the logics are right.
    Cheers,
    Abhi...

  • How to use "where" clause in modify statement

    Hi
    can any1 telll me is it possible to use a where clause in a modify statemetn. I want to use modify statemetn  to insert a new recoed in a database table.
    Regards
    Sabahuddin Ahmed

    MODIFY itab - itab_lines
    Syntax :
    ... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
    With these additions the MODIFY statement assigns the content of the comp1 comp2 ... components of the wa work area specified after TRANSPORTING to all lines in the itab table that meet the logical condition log_exp. The wa work area must be compatible with the line type of the internal table.
    The TRANSPORTING addition has the same effect as changing individual lines. The WHERE addition can only be specified together with the TRANSPORTING addition. After WHERE, any logical expression can be specified in which the first operand of each individual comparison is a component of the internal table. All logical expressions are therefore possible, with the exception of IS ASSIGNED, , and IS SUPPLIED. It is not possible to dynamically specify a component using bracketed character-type data objects.
    While for standard tables and hashed tables all lines in the internal table are checked for the logical expression of the WHERE statement, for sorted tables, optimized access can be achieved by checking at least one opening part of the table key for parity using AND linked queries in the logical expression.
    Example
    Change the contents of the planetype component for all lines in the sflight_tab internal table in which this component contains the value p_plane1 to the value p_plane2.
    PARAMETERS: p_carrid TYPE sflight-carrid,
                p_connid TYPE sflight-connid,
                p_plane1 TYPE sflight-planetype,
                p_plane2 TYPE sflight-planetype.
    DATA sflight_tab TYPE SORTED TABLE OF sflight
                     WITH UNIQUE KEY carrid connid fldate.
    DATA sflight_wa TYPE sflight.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab
           WHERE carrid = p_carrid AND
                 connid = p_connid.
    sflight_wa-planetype = p_plane2.
    MODIFY sflight_tab FROM sflight_wa
           TRANSPORTING planetype WHERE planetype = p_plane1.
    reward if useful

  • How to change where clause in VO query in bean

    Hi experts
    I have to modify vo object query where clause on run time .. is it possible??
    if yes please suggest me,

    as mentioned by Timo, it is very much possible
    see this following link -
    Changing the WHERE clause or VO Query at runtime in Oracle ADF | Techartifact
    Dynamically changing query in view object in Oracle ADF | Techartifact

  • How to write WHERE clause in dynamic record group in oracle forms

    hi this is s.v.eswar,PLZ HELP ME
    i am new to oracle forms
    i want to write where clause in dynamic recordgroup
    this is the code i have written
    DECLARE
         MGR_ITEM ITEM:=FIND_ITEM('MGR');
         RG_ID_MGR RECORDGROUP:=NULL;
         MGR_DUMMY NUMBER;
    BEGIN
         RG_ID_MGR:=FIND_GROUP('MGRNUMBER');
         IF ID_NULL(RG_ID_MGR) THEN
              RG_ID_MGR:=CREATE_GROUP_FROM_QUERY('MGRNUMBER','SELECT DISTINCT TO_CHAR(EMPNO),TO_CHAR(EMPNO) FROM EMP WHERE JOB='MANAGER''); --THIS IS THE LINE I AM GETTING ERROR
         END IF;
         IF NOT ID_NULL(RG_ID_MGR) THEN
              MGR_DUMMY:=POPULATE_GROUP('MGRNUMBER');
              IF MGR_DUMMY=0 THEN
                   POPULATE_LIST(MGR_ITEM,'MGRNUMBER');
              END IF;          
         END IF;     
    END;
    COMPILE TIME ERROR
    1)I have written where clause like this WHERE JOB='MANAGER'
    then oracle compiler has given error like
    ENCOUNTERED THE SYMBOL 'MANAGER' WHEN EXPECTING ONE OF THE FOLLOWING .,().........etc
    (FOR THE ABOVE ERROR I JUST REMOVED SINGLE CODES AND WRITE LIKE THIS ----->WHERE JOB=MANAHER)------>THEN COMPILED SUCESSFULLY)
    AND I RUN THE FORM
    RUN TIME ERROR
    FRM-41072: CAN NOT CREATE GROUP 'MGRNUMBER'

    Hi there
    pls have a look here
    Dependent drop down lists in forms 6i
    hope this helps...
    regards,
    Amatu Allah

  • How to canel where clause equal effect

    hi all
    in JPAQL
    i wanna cancel the where clause effect in order to use the following example query
    select u from user u where u.name= :name
    the question is what to put for the value of the parameter:name to make the query get all the objects ,ie. make it match against any name,i know that this can be achieved with omiting the where clause alltogether but my real world query is much complex and i cannot guarentee that each time i run the query all the parameters will be assigned so i want to neutralize the effect of effect of the unassigned parameters by making a default that get all objects, i cannot use dynamically generated sql or jpaql as my db perform much much better with precompiled queries
    please help me and tell me if ur solution is portable among JPA providers(in the spec )or just available in KODO
    thanx alot

    hi all
    in JPAQL
    i wanna cancel the where clause effect in order to use the following example query
    select u from user u where u.name= :name
    the question is what to put for the value of the parameter:name to make the query get all the objects ,ie. make it match against any name,i know that this can be achieved with omiting the where clause alltogether but my real world query is much complex and i cannot guarentee that each time i run the query all the parameters will be assigned so i want to neutralize the effect of effect of the unassigned parameters by making a default that get all objects, i cannot use dynamically generated sql or jpaql as my db perform much much better with precompiled queries
    please help me and tell me if ur solution is portable among JPA providers(in the spec )or just available in KODO
    thanx alot

  • How to reverse where clause condition? please

    Hello Good Morning,
    i have below query which is working fine,
    update t
    set skipjet='Yes'
    from  mytable t join mychildtable C on t.ssn=c.ssn
    where
    t.ChannelCd ='OB Calls' AND t.PlanBlance BETWEEN c.MinSalary  AND  c.MaxSalary
    but my problem here is, i have to set skipjet='Y' when the above where clause not met (like opposite way)
    Please advise?
    Thank you in Advance
    Asita

    Dear Milano, 
    I did an example and i got the result that you needed.
    declare @mytable table (ssn int,ChannelCd varchar(50),PlanBlance money,skipjet varchar(3))
    declare @mychildtable table (ssn int,MinSalary money,MaxSalary money)
    insert into @mytable(ssn,ChannelCd,PlanBlance,skipjet) values (1,'OB Calls',800.00,'NO')
    insert into @mytable(ssn,ChannelCd,PlanBlance,skipjet) values (1,'OB Calls2',800.00,'NO')
    insert into @mychildtable(ssn,MinSalary,MaxSalary)values(1,600.00,800.00)
    update t set skipjet='Yes'
    from
    @mytable t
    where
    not exists (
    Select * from
    @mychildtable C
    where
    t.ssn=c.ssn and
    t.ChannelCd ='OB Calls' AND
    t.PlanBlance BETWEEN c.MinSalary AND c.MaxSalary
    Select * from @mytable
    Result:
    ssn         ChannelCd                                      PlanBlance           skipjet
    1           OB Calls                                           800,00                NO
    1           OB Calls2                                         800,00                Yes
    (2 row(s) affected)
    Ricardo Lacerda
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Invalid relational operator in where clause dynamic

    I have a procedure where I pass the WHERE CLAUSE as a parameter like this:
    PROCEDURE PRC_CONSULTAR_AFIL_PEND(PV_WHERE IN VARCHAR2,
    RESULTSETM IN OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN RESULTSETM FOR
    'SELECT PAISAFIL,
    TIPDOCAFIL,
    NUMDOCAFIL,
    APPAFIL,
    APMAFIL,
    NOMAFIL,
    SEXAFIL,
    FECNACAFIL,
    CODPNA,
    ESTADO,
    FECHA,
    TO_DATE(FECGEN),
    NOMCOLUMN
    FROM SUNAFILERR
    WHERE ' || PV_WHERE;
    I am passing the where clause as: 'APPAFIL'||' '||'APMAFIL'||' '||'NOMAFIL LIKE UPPER(rojas%)'

    Miguel Angel wrote:
    I have a procedure where I pass the WHERE CLAUSE as a parameter like this:
    PROCEDURE PRC_CONSULTAR_AFIL_PEND(PV_WHERE IN VARCHAR2,
    RESULTSETM IN OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN RESULTSETM FOR
    'SELECT PAISAFIL,
    TIPDOCAFIL,
    NUMDOCAFIL,
    APPAFIL,
    APMAFIL,
    NOMAFIL,
    SEXAFIL,
    FECNACAFIL,
    CODPNA,
    ESTADO,
    FECHA,
    TO_DATE(FECGEN),
    NOMCOLUMN
    FROM SUNAFILERR
    WHERE ' || PV_WHERE;
    I am passing the where clause as: 'APPAFIL'||' '||'APMAFIL'||' '||'NOMAFIL LIKE UPPER(rojas%)'So your where clause is
    WHERE APPAFIL APMAFIL NOMAFIL LIKE UPPER (rojas%)Can you see why that's an error? It would make more sense if there was an operator between APPAFIL and APMAFIL, but then there's obviously something missing between APMAFIL and NOMAFIL as well, and some quotes missing later on.
    The following is valid SQL code
    WHERE   APPAFIL  != APMAFIL
    AND     NOMAFIL  LIKE UPPER ('rojas%')Of course, I have no idea if that's what you want or not.
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements) for any tables used, and the results you want from that data.
    if the problem involves parameters (such as the pv_where), then post a couple of different parameters, and the results you want from the same sample data for each parameter.
    Explain how you get those results from that parameter and that data.
    Always say which version of Oracle you're using.

  • Dynamically set ViewObject where clause dynamically from Java bean

    I have a requirement to display all of the records from a table when the JSP is first brought up, so my View Object looks like this:
    "select emp_name from emp"
    Then the users wants to ability to pass paramters to that View Object to refine the list so from by Java class I tried to do this:
    ViewObject vo = cpd.findViewObject("EmpViewObject");
    vo.setWhereClause("empName = :1");
    vo.setWhereClauseParam(1,varEmpName);
    vo.executeQuery();
    But I am getting JBO errors and I'm not sure what I'm doing wrong. Can anyone offer a hint as to how I can do this?

    this is exactly how the code is done -
    1. emp_name in the View Object
    2. emp_name in the where clause
    The two are identical. I have tried many variations of this - any time I set the where clause from my bean I get an error.
    When I take the SQL stmnt and run it in TOAD it returns expected rows when I run it in the SQL worksheet in JDev it gives an invalid Identifier - but if I hard code the where clause in the View Object it returns the same results as TOAD.

  • Adding filter conditions dynamically in WHERE clause -dynamic SQL help

    Here I have a simple condition but very complicated query. Basically, I have to put a filter condition in my where clause. "Location" comes to the stored procedure as parameter. Plus there are other parameters as well.
    If location = "all", I can run the query simply and get the result. But when Location = "CA", which is just a subset of "ALL" then I am having hard time putting one -- AND statement in WHERE clause.
    This query is designed for location = 'ALL'
    open cv for
    'Select col1, col2, col3, Col4
    from t1, t2, t3
    WHERE condition1
    AND condition2
    AND condition3'
    AND location = location_id --- This should only run if location IS NOT ALL
    I have written a dynamic query but it doesn't work for that part. Any ideas will be appreciated. Thanks,

    From what I understood
    If location = 'ALL' then
    fetch all the records
    Else
    add extra filter location_id = <supplied location id>
    End If
    If this is the condition the following logic should solve your issue.
    open cv for
    'Select col1, col2, col3, Col4
    from t1, t2, t3
    WHERE condition1
    AND condition2
    AND condition3'
    AND ((location_id = location_id and location = 'ALL') or (location_id = location))Regards
    Raj

Maybe you are looking for