URGEN: How to programmatically assign bind variables in View Object

Hi,
I have a method action in my pagedef
<methodAction id="SetBindAttributeValueToQuotationsView"
                  InstanceName="QuotationsEBAppModuleDataControl.dataProvider"
                  DataControl="QuotationsEBAppModuleDataControl"
                  MethodName="SetBindAttributeValueToQuotationsView"
                  RequiresUpdateModel="true"
                  Action="999" IsViewObjectMethod="false">
      <NamedData NDName="quotTransNo"
                 NDValue="${bindings.SetBindAttributeValueToQuotationsView_quotTransNo}"
                 NDType="java.lang.Integer" NDOption="2"/>
    </methodAction>Im going to assign values to the bind variables and use the method action in my pagedef.
Thanks.

hi
u check ur view name & page def binds value,
both of them should be same
thanks

Similar Messages

  • How to populate bind variable in view objects where clause in ADF faces

    I've got a page with 2 input items.
    The user manually enters the first value.
    On the second input item I have created a LOV for the item which opens in a popup. How do I restrict the data returned in the LOV using the value entered in the first input item. I have created a bind variable and have included it in the where clause for the view object but how do I populated it.

    Here is an example:
    Using the HR schema with the EMPLOYEES and DEPARTMENTS tables.
    Example is using ADF BC and created an EMPLOYEES entity with an updateable view object for page,
    and created a DEPARTMENTS view as a lookup
    (SQL: select department_id, department_name from departments where department_name = :DeptName)
    1: add method to the backing bean to filter the LOV
    public void getTextValueToFilterLOV(ValueChangeEvent valueChangeEvent) {
    Object value_from_form = valueChangeEvent.getNewValue();
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application fapp = fctx.getApplication();
    JUFormBinding formBinding = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
    DCIteratorBinding dcBinding = (DCIteratorBinding)formBinding.get("DeptLOVIterator");
    ViewObject vo = dcBinding.getViewObject();
    vo.setNamedWhereClauseParam("DeptName",value_from_form);
    vo.executeQuery();
    2. add valueChangeListener to the inputText on the page with an id and autoSubmit="true"
    <af:inputText value="#{bindings.LastName.inputValue}" label="#{bindings.LastName.label}" binding="#{backing_DeptForm.inputText3}"
    id="inputText3"
    autoSubmit="true"
    valueChangeListener="#{backing_DeptForm.getTextValueToFilterLOV}">
    </af:inputText>
    3. reference the LOV with the id name on the partialTriggers property
    <af:selectOneChoice value="#{bindings.EmployeesUpdView1DepartmentId.inputValue}"
    label="#{bindings.EmployeesUpdView1DepartmentId.label}" binding="#{backing_DeptForm.selectOneChoice1}"
    id="selectOneChoice1"
    partialTriggers="inputText3">
    <f:selectItems value="#{bindings.EmployeesUpdView1DepartmentId.items}"
    binding="#{backing_DeptForm.selectItems1}"
    id="selectItems1"/>
    </af:selectOneChoice>
    Summary:
    When you entered a text (LastName), that value is passed into the backing bean method.
    The Bean method code will find the LOV Iterator and put the value into the bind variable.
    Cheers,
    Jim

  • Setting bind variables in view objects for LOV

    ADF 11.1.1.1.0
    I have two application modules - amCodeTable (contains the code tables) and amLOV (contains the list of values)
    In amLOV I have a VO aListOfValuesVo (not based on an entity) that runs a query Select * from aTable where userNr = :pBindVar
    In amCodeTable I have a VO aMainTableVo based on an EO, This VO has a field (aLOVField) which has a LOV defined on it and uses the
    aListOfValuesVo.
    I've hardcoded the bind parameter to its corresponding value and everything works as expected, list of values from
    aListOfValuesVo available on the aLOVField in aMainTableVo.
    I now need to set the bind parameter by code.
    What I have tried to do is override the execute query of the aListOfValuesVo in the aListOfValuesVoImpl.java
        @Override
        public void executeQuery() {
           setNamedWhereClauseParam("pBindVar","32");
           super.executeQuery();       
        }If I test the amLOV application module the query returns the correct values.
    If I test the amCodeTable the list of values on the aLOVField in the view aMainTableVo is empty.
    I've added a breakpoint to the executeQuery() method but it would seem that the method is not called.
    How are bind parameters for list of values set ?
    Paul

    Ok I've activated an SQL trace and got the following :
    [498] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.doSetWhereClause(-1, pUserNr, null)
    [499] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.execute caused params to be "un"changed
    [500] Column count: 4
    [501] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0 ViewRowSetImpl.doSetWhereClause(-1, pUserNr, null)
    [502] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch ViewRowSetImpl.setNamedWhereClauseParam(pUserNr, 41)
    [503] ViewObject: _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch Created new QUERY statement
    [504] _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch>#q computed SQLStmtBufLen: 238, actual=198, storing=228
    [505] Select b.Branch_Nr,Decode(b.status,1,'','*')||b.Branch_Id DisplayId,b.Designation,b.Status
    from stt_branch b, stt_users_branch u
    where u.user_nr = :pUserNr
    and b.Branch_Nr = u.Branch_nr
    order by 4,1
    [506] Bind params for ViewObject: _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch
    [507] For RowSet : _LOCAL_VIEW_USAGE_ch_mit_trac_model_views_codeTables_SttIncotermView_lovUserBranch_0
    [508] Binding null of type 12 for "pUserNr"To me this looks as if 2 lovUserBranch instances have been created a lovUserBranch and a lovUserBranch_0
    The parameter is being binded to the lovUserBranch but the LOV is using the lovUserBranch_0 which has a bind value of null
    Anybody got any idea as to what is happening ?
    Regards
    Paul

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How can I assign javascript variables to jsp or java variables.?

    How can I assign javascript variables to jsp or java variables.?

    See I have generated some variables in the javascript which is on the jsp page. I want to assgin these variables to the jsp vaiables. Or how can I access javascript variables from jsp on the same jsp page.

  • How can i create "bind variable"

    How can i create "bind variable" in my DB to support any procedure in my DB.
    Thank you very much.

    In SQL*PLUS we can defined bind variable
    SQL>var x varchar2(250); -- Is x bind variable or i'm misunderstand ?
    and ... in my procedure i can used ' &x ' to pass valued of 'x' from sql prompt to my procedure.
    but i'm not sure variable x is still remain in DB because i need to pass variable
    " v_stmt := 'and employee_id between ..... ' " from FORM to PROCEDURE in DB
    how can i do

  • How to properly set bind variables

    Dear All,
    I am currently confused about how to properly set my Bind Variables
    I have this view using HR standard schema
    Select *
    from Employees
    where EMPLOYEE_ID = :EMP_IDI somehow see three options on how to use this bind variable in an application module.
    Option 1:
    ViewObjectImpl view = this.getEmployeesView();
    VariableValueManager vm = view.ensureVariableManager();
    vm.setVariableValue("EMP_ID", value);
    view.executeQuery();Option 2:
    ViewObjectImpl view = this.getEmployeesView();
    view.setNamedWhereClauseParam("EMP_ID", value);
    view.executeQuery();Option 3:
    EmployeeViewImpl empView =this.getEmployeesView();
    RowSetIterator it = empView.createRowSetIterator(null);
    empView.setEmployeeId(value);
    empView.executeQuery();Question is which is which and what should I use?
    JDEV 11G PS3

    I use is this
    DCIteratorBinding iteratorStatus = Util.getIterator("NameIterator");
    operationBinding.execute();
    Util is reserved in a class.
    public static DCIteratorBinding getIterator(String iteratorName){
    return getDCBindings().findIteratorBinding(iteratorName);
    }

  • How to identify the bind variable peeking problem?

    How to identify the bind variable peeking problem whether my db hitting or not and how to resolve it?
    currently we are doing the dbms_stat of application schema's with gather auto option and i hope this option we take the histogram stats also. Is there any option to improve it and its highly transactions oltp env of 11g.

    What is your exact 4 digits Oracle version ?
    Bind peeking issues are supposed to be solved with adaptative cursor sharing in 11.1 and 11.2:
    11.1 http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/optimops.htm#sthref919.
    11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/optimops.htm#PFGRF94588
    which says also:
    >
    Adaptive cursor sharing is enabled for the database by default and cannot be disabled. Note that adaptive cursor sharing does not apply to SQL statements containing more than 14 bind variables.
    >
    Edited by: P. Forstmann on 10 nov. 2011 13:50

  • Error when Setting value to Bind variable in View Link used in HGrid

    Hi
    I have requirement to pass profile id as bind variable, I have created a VO based on below Query.
    select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1
    View Link Query that is being generated is
    SELECT * FROM (select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1) QRSLT WHERE PARENT_ID = :Bind_ChildId
    it Shows Errors as
    ## Detail 0 ##
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    could anyone tell what could be the wrong. Do we need to set bind variable in view link Explicitly? or any other alternative.
    Its very Urgent.
    Regards
    Vimal

    Hi,
    I have faced similar problem some time ago. I could not find any solution except removing bind parameters in where clause. I tried to change binding style but it also didn't work. I think the problem is caused by view link's where clause.

  • Bind variables in views

    I am having some performance issues using bind variables in views (Oracle 7.3.4). When I execute the view using '' values the view executes the expected execution plan. When I execute the view using bind variables the execution plan changes to something undesireable. I believe this to be a static execution plan in the case of using bind variables. I have updated all tables referenced by the view and compiled the view; but, the execution plan when using the bind variables does not change. Can you give me some advice on finding out why the execution plan in the case of using bind variables does not change based on the new set of statistics and being re-compiled.

    even if you use a literal isn't that automatically
    changed into a bind variable during at compile time?That would be the case when your have CURSOR_SHARING = FORCE. The default should be EXACT.
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    SQL>Actually, since you have the constants in the view, and if everyone uses the view, they share the same shared cursor (since the constants are never changing across each use).
    If you supplement the view with additional WHERE conditions (when using the view):
    SELECT <columns> FROM your_view WHERE <additional_conditions> ;
    Ten you might want to look into using bind variables for values used in such additional conditions.

  • Dynamically change the Binding of a view object

    I want to reuse a panel several times in my application. The VO has one bind parameter (:1). The same panel should be reused several times with different bind variables.
    I found a technical note concerning this issue called: How to Dynamically Change the binding of a View Object to a JClient Panel. This works for JDeveloper 9i but not for JDeveloper 19g. Does anybody know how to dynamically change the binding in JDeveloper 10g

    You may use bindRowSetIterator() and pass in a custom fetched ViewObject or a RowSetIterator to the iterator binding that is displayed in your panel.

  • 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 pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • How to querie with bind variable in findMode?

    Hallo,
    is it possible to use a querie with bind variable in findMode? And when how is it possible to initialize the bind variable?
    Any help is appreciated.

    Hi,
    bind variables can be linked from teh ADF binding to e.g. a managed bean, the sessionScope or other binding attributes via EL. So when you go into findMode and execute the query, the EL will grab the bindVariable values automatically.
    Frank

Maybe you are looking for

  • How to tell if a machine is compromised?

    Is there a definitive way to confirm that a machine has been compromised and and allowing an outside user hidden access? I'm not quite sure what the limits are on how much the reality can be distorted. I know teh logs can be altered and system binari

  • Someone help, my phone wont turn on

    i plugged my iphone into speakers today and the screen went fuzzy and it went off. it has not came back on and i have tried holding the power button in and also tried holding both power button and home button in. its an ihpone 4. if anyone has any su

  • ODS and ODSSM schemas not created in oracle 11.1.0.2 on Win 2008 R2 server

    Hi, I'm trying to install webcenter suite installation on windows 2008 R2 server. As a starting point installed oracle db 11.2.0.1 As a second step, tried to run rcu script and found that the ODS and ODSSM schemas are not created as a part of the ins

  • XML as source in SSIS: needed one single tab as destination

    Hi As source in SSIS I have an XML file and as destination an Excel file. SSIS produces in Excel as many tabs as blocks in XML. The last column in every tab contains some IDs like for instance employee_id. Such IDs are not found in the XML file. In m

  • Error in HTTP to RFC secnario

    Hi, Hi, I am working on a HTTP-RFC scenario. The bapi that I am using is BAPI_PR_GETDETAIL. If I send a PR number from my HTTP client, I am supposed to get the details of that PR as my response. But I am getting this error: "<SAP:Category>Application