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.

Similar Messages

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

  • Null check for a bind variable in view criteria

    Hi, Greetings.
    I am using Jdeveloper 11.1.2.0.
    I have a view object, LocationsView, for locations table of the XE database.
    I want to apply a condition, ((:bind_var is null) or (:bind_var is not null and location_id = :bind_var), in this LocationsView.
    That is, I want to apply the condition only if the bind variable value is not null.
    How can I construct this condition using a declarative view criteria?
    Any help and hints on this regard is greatly appreciated.
    Regards,
    Guru K

    Hi,
    Thanks for the update and it is working perfectly fine.
    Now, how can I set the "ignore null values" option as checked if I am constructing the criteria programmatically using view criteria row and view criteria item at runtime.
    Thanks and regards,
    Guru K

  • 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

  • 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

  • Bind variable for view accessor

    I am using a Gantt chart where I need to pass in a date field for the schedule as a bind variable.
    Since this is a Gantt chart, there is no iterator binding for the child VO (the tasks) in my page definition.
        <gantt IterBinding="ParentVO1Iterator" id="ParentsVO1" xmlns="http://xmlns.oracle.com/adfm/dvt">
          <ganttDataMap>
            <nodeDefinition DefName="com.pat.model.view.ParentsVO" type="Resources">
              <AttrNames>
                <Item Value="ParentId" type="resourceId"/>
              </AttrNames>
              <Accessors>
                <Item Value="MainGantt" type="tasks"/>
              </Accessors>
            </nodeDefinition>
            <nodeDefinition type="Tasks" DefName="com.pat.model.view.MainGantt">
              <AttrNames>
                <Item Value="PatId" type="taskId"/>
                <Item Value="StartTimeDate" type="startTime"/>
                <Item Value="EndTimeDate" type="endTime"/>
                <Item Value="Patname" type="label"/>
              </AttrNames>
            </nodeDefinition>
    I have tried retrieving the accessor through the parent VO, and setting the bind variable.
    But I get an error if I fire executeQuery() on the child VO that says that the bind variable for the view link is missing.
            DCIteratorBinding iter = dcBindings.findIteratorBinding("ParentVO1Iterator"); // get parent iterator binding
            ViewObject vo = iter.getViewObject();
            MainGanttImpl childVO = (MainGanttImpl)vo.findAttributeDef("MainGantt").getAccessorVO(vo); //get the child VO through the accessor link
            childVO.setpViewDate(new Timestamp(((Date)getGanttDate().getValue()).getTime())); // get the date entered by the user and set to the child VO
            childVO.executeQuery(); //execute the child VO
    Exposing the child VO impl through the Application module and setting the bind variable to that instance alone has no impact on the Gantt data returned.

    We researched a bit more and hit upon the solution here.
    Decompiling ADF Binaries: Search by child attributes on a tree table
    I added the same bind variable to my parent VO (and added some SQL 'and : pViewDate = : pViewDate' to the query to just get it to work )
    In the parent VO Impl class, I overrode the createViewLinkAccessorRS method:
       protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl assocDef,
                                                          ViewObjectImpl accessorVO,
                                                          Row masterRow,
                                                          Object[] values) {
                ViewRowSetImpl v =
                super.createViewLinkAccessorRS(assocDef, accessorVO, masterRow,
                                               values);
          //  Timestamp viewDate = (Timestamp )accessorVO.getNamedWhereClauseParam("pViewDate");
            v.setNamedWhereClauseParam("pViewDate", getpViewDate());
            return v;                                                    
      public Timestamp getpViewDate() {
            return (Timestamp) getNamedWhereClauseParam("pViewDate");
    This sets the child VO with the value of the bind variable that I have set to my parent VO. This got the Gantt working!

  • 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

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • BUG ? :  ADF creating extra VO instance using bind variables in a LOV query

    ADF 11.1.1.1.0
    After "playing around" with bind variables Setting bind variables in view objects for LOV I've come across something strange that I've reproduce using the HR schema and tables Employees and Departments. Its a bit long but here goes :
    Using the HR schema tables departments and employeesI'm trying to create a LOV (selectOneChoice) for the
    employee department, the LOV having a bind variable that limits the values returned in this case returning only DepartmentId = 50
    I've create a VO lovDepartment (not based on an EO) with the following query :
    SELECT Departments.DEPARTMENT_ID,
           Departments.DEPARTMENT_NAME,
           Departments.MANAGER_ID,
           Departments.LOCATION_ID
    FROM DEPARTMENTS Departments
    where DEPARTMENT_ID  = :pDeptIdA LOV has been defined on the DepartmentId attribute of the EmployeesView.
    The lovDepartmentImpl overrides the executeQueryForCollection to set the bind variable value.
        @Override
        protected void executeQueryForCollection(Object object, Object[] object2,
                                                 int i) {
            setNamedWhereClauseParam("pDeptId", "50");       
            super.executeQueryForCollection(object, object2, i);
        }When using an ADF form to create a new employee the DepartmentId lov is empty.
    Enabling SQL tracing shows the following :
    [370] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.doSetWhereClause(-1, pDeptId, null)
    [371] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.execute caused params to be "un"changed
    [372] Column count: 4
    [373] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.doSetWhereClause(-1, pDeptId, null)
    [374] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1 ViewRowSetImpl.setNamedWhereClauseParam(pDeptId, 50)
    [375] ViewObject: _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1 Created new QUERY statement
    [376] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1>#q computed SQLStmtBufLen: 235, actual=195, storing=225
    [377] SELECT Departments.DEPARTMENT_ID,
           Departments.DEPARTMENT_NAME,
           Departments.MANAGER_ID,
           Departments.LOCATION_ID
    FROM DEPARTMENTS Departments
    where DEPARTMENT_ID  = :pDeptId
    [378] Bind params for ViewObject: _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1
    [379] For RowSet : _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0
    [380] Binding null of type 12 for "pDeptId"
    [381] No Resource Bundle found but null value id:LOV_DepartmentId_LOVUIHints_NullValueId is defined in an ListBinding Definition.It would seem that 2 lovDepartment instances are used one at line 370 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1_0
    and one at line 374 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1
    The one at line 374 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1 gets the variable bound at line 374
    however LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1_0 gets a null value and would explain the empty LOV
    Can anybody explain what is happening here ? (and how to use bind variables in LOV queries)
    Regards
    Paul
    (bump)
    Edited by: Paul (MITsa) on Jul 14, 2009 10:46 AM
    I've now tried all types of LOV from ChoiceList to Radio groupe by testing the application module - none of them work.....
    Edited by: Paul (MITsa) on 14-Jul-2009 22:52

    when you rinvoke executeQueryForCollection the bind variables are allready set and they exist in Object[] object2 method parameters.
    in order to change them you need something like:
    private void changeGenericBindVariable(Object[] params, String paramName, Object paramValue) {
    for (int i = 0; i < params.length; i++) {
    if (paramName.equals(((Object[])params)[0].toString()))
    ((Object[])params[i])[1] = paramValue;
    * executeQueryForCollection - overridden for custom java data source support.
    protected void executeQueryForCollection(Object qc, Object[] params,
    int noUserParams) {
    changeGenericBindVariable(params, "pDeptId", "50")
    super.executeQueryForCollection(object, object2, i);
    But its better to set bind variables before you executeQueryForCollection. like when you invoke LOV.
    For cascading LOVs and the problems i have check:
    [http://adfbugs.blogspot.com/2009/07/jdeveloper-11-r1-cascading-lov-bugs.html]

  • View with Bind Variable and ADF table

    Hi all,
    Please note what i have noticed. I created a view with a bind parameter, overriden the prepareSession of my Application Module to set the bind parameter and execute the query. I then created a simple jsf page and included the view as an adf read-only table. When i run the page, the prepareSession is called, sets the bind parameter, however the selected record of the table is always the second record (Not the first record).
    This behaviour can be reproduced with the HR schema. Please follow the below instructions for reproducing the problem.
    1. Create a Fusion Web Application (ADF).
    2. Create business components from tables.
    3. Create a new connection with the HR schema.
    4. Import the Departments table as an entity and then click finish.
    5. Create a view based on the Departments entity.
    6. Modify the Query to include a where clause (where DDepartmentsEO.DEPARTMENT_NAME LIKE :BindParam)
    7. Provide an order by clause (DepartmentsEO.DEPARTMENT_ID DESC)
    8. Creata a bind variable named "BindParam" of type string.
    9. Create an Application Module and include the view object.
    10. Open the Application Module Class and override the prepareSession method
    11. include the following code after super.prepareSession(session):
    ViewObject myView = this.getDepartments1();
    myView.setNamedWhereClauseParam("BindParam", "%");
    myView.executeQuery();
    12. Create a jsf page
    13. Drag the view object on the page as an adf read-only table, selecting the Row Selection, Sorting and Filtering
    14. Run the page.
    You will see that instead of the first record being selected, the second record in the table is selected.
    Can anyone please help me?
    Thank you

    First of all i would like to thank you for replying to my thread.
    Secondly, i would like to inform you that the example that i have provided is just for REPRODUCTION purposes.
    The real scenario has to do with setting the where clause with the authenticated user so that the view will query for data only associated with the authenticated user.
    The only way to overcome this behaviour is to include a view action (namedWhereClause in the page definition)
    However, this is not how i want to implement this. This was working properly in 10g

  • Detail view with bind variable. TreeTable not showing all detail result.

    I’m having trouble with treeTable using detail view with bind variables and where clause defined in VO definition.
    Both, master and detail view objects, base on the same entity and have the same condition in where clause. The view objects also have bind variables, which are set in prepareRowSetForQuery() method.
    Again, these are two different views, that get different result, based on value of one of the bind variable.
    When I show results in two different tables on jsf page, where master table has "RowSelection" set on "single", all results are displayed in detail table.
    But when I use treeTable, only the first result of the detail is shown.

    I tested it in applicationModule and it works, but i think that's the same as two tables on a jsf page.
    This is the order in which overridden methods are called in ADF BC or two tables on jsf page
    when clicking on row in master table.
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;  -> print of the object2[] parameter in executeQueryForCollection
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313 -> viewLink parameter value
    getEstimatedRowCount_Detail
    count: 2
    getEstimatedRowCount_Detail
    count: 2 And when i click on "expand node" in tree table:
    getEstimatedRowCount_Root
    count: 2
    PrepareRowSetForQuery_Detail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035321
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035313
    PrepareRowSetForQueryDetail
    executeQueryForCollection_Detail user param: 2
       Object 2: class [Ljava.lang.Object;
         List 0: Bind_ChildId -> viewLink parameter
         List 1: 400035321
    getEstimatedRowCount_Root
    count: 2
    getEstimatedRowCount_Root
    count: 2Values of user parameters are OK. Is there another method that i should override?
    I also noticed, that if detail view doesn't have user bind variables, the tree works fine and is shown even in ADF BC (aplication module).
    I guess we loose a tree, when using bind variables in detail view object.
    Is there a way around it?

  • Using bind variables in the model view for master detail

    Hi all,
    I have a master-detail views setup on the following two queries.
    In the first query below - I use two bind variables to collect the start and end date.
    you have to add (and :startDate = :startDate and :endDate = :endDate) or you will get errors - bind not defined in sql
    I then use the viewQueryCriteria to collect the data on a search panel - so far so good. (Make the bind variables required) along with the other criteria.
    The bind variables are displayed in the search panel and the data is entered correctly.
    The query executes and all is happy.
    VIEWOBJECT1
    SELECT DepositAccounts.COA_ID,
    ... ChartOfAccounts.ACCOUNT_CODE || ' ' || ChartOfAccounts.ACCOUNT_TITLE as description
    FROM DEPOSIT_ACCOUNTS DepositAccounts, DEPOSIT_ACCOUNT_DETAILS DepositAccountDetails, CHART_OF_ACCOUNTS ChartOfAccounts
    WHERE DepositAccounts.ID = DepositAccountDetails.DEP_ACC_ID
    and ChartOfAccounts.id = DepositAccountDetails.COA_ID
    and :startDate = :startDate and :endDate = :endDate
    Now I add the summation of a value (AMOUNT) to the view object (java - create view impl) to the VOViewRowImpl
    and everything works - the value is shown in the transient attribute formatted and looking nice.
    VIEWOBJECT2
    SELECT PostingBatchAccounts.AMOUNT,
    FROM POSTING_BATCH_ACCOUNTS PostingBatchAccounts, POSTING_BATCHES PostingBatches
    where PostingBatchAccounts.PB_ID = PostingBatches.ID
    and PostingBatches.SOURCE_DATE between :startDate and :endDate
    Now I need to add the start date and end date to the child query - before the view executes (or the summation is calculated).
    The attributes are in the where clause (PostingBatches.SOURCE_DATE between :startDate and :endDate) in VIEWOBJECT2 which is the child.
    I need the child records and the summation to work with the date restrictions.
    I would assume you could get access to the child view in the VOViewImpl file and set the bind variables there.
    Everything I find is based on the JSF - not the model layer - this should be fairly easy (and common). can anyone give me a hand on this?

    Hi all,
    I have a master-detail views setup on the following two queries.
    In the first query below - I use two bind variables to collect the start and end date.
    you have to add (and :startDate = :startDate and :endDate = :endDate) or you will get errors - bind not defined in sql
    I then use the viewQueryCriteria to collect the data on a search panel - so far so good. (Make the bind variables required) along with the other criteria.
    The bind variables are displayed in the search panel and the data is entered correctly.
    The query executes and all is happy.
    VIEWOBJECT1
    SELECT DepositAccounts.COA_ID,
    ... ChartOfAccounts.ACCOUNT_CODE || ' ' || ChartOfAccounts.ACCOUNT_TITLE as description
    FROM DEPOSIT_ACCOUNTS DepositAccounts, DEPOSIT_ACCOUNT_DETAILS DepositAccountDetails, CHART_OF_ACCOUNTS ChartOfAccounts
    WHERE DepositAccounts.ID = DepositAccountDetails.DEP_ACC_ID
    and ChartOfAccounts.id = DepositAccountDetails.COA_ID
    and :startDate = :startDate and :endDate = :endDate
    Now I add the summation of a value (AMOUNT) to the view object (java - create view impl) to the VOViewRowImpl
    and everything works - the value is shown in the transient attribute formatted and looking nice.
    VIEWOBJECT2
    SELECT PostingBatchAccounts.AMOUNT,
    FROM POSTING_BATCH_ACCOUNTS PostingBatchAccounts, POSTING_BATCHES PostingBatches
    where PostingBatchAccounts.PB_ID = PostingBatches.ID
    and PostingBatches.SOURCE_DATE between :startDate and :endDate
    Now I need to add the start date and end date to the child query - before the view executes (or the summation is calculated).
    The attributes are in the where clause (PostingBatches.SOURCE_DATE between :startDate and :endDate) in VIEWOBJECT2 which is the child.
    I need the child records and the summation to work with the date restrictions.
    I would assume you could get access to the child view in the VOViewImpl file and set the bind variables there.
    Everything I find is based on the JSF - not the model layer - this should be fairly easy (and common). can anyone give me a hand on this?

  • Dynamic view object loses bind variables after passivation

    I am creating a view object definition/view object programmatically in Jdev 11.1.1.2.0. The query requires a named bind parameter. All was working fine but now I am testing with app module pooling disabled and the bind variable is not being restored after passivation -- it's like the definition has disappeared or something.
    Here is my VO creation code:
    ViewObject vo = findViewObject("FinalistsWithEvalDataVO");
    if (vo != null){
    vo.remove();
    ViewDefImpl voDef = new ViewDefImpl("FinalistsWithEvalDataVODef");
         // I add a bunch of viewAttrs here...
    voDef.setQuery(fullQuery);
    voDef.setFullSql(true);
    voDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    voDef.resolveDefObject();
    voDef.registerDefObject();
    vo = createViewObject("FinalistsWithEvalDataVO", voDef);
    vo.defineNamedWhereClauseParam("Bind_SchlrAyId", null, new int[] {0});
    vo.setNamedWhereClauseParam("Bind_SchlrAyId", new Number(1)); //For testing
    vo.executeQuery();
    The query executes fine right there and then the VO seems to passivate fine. I even see the bind var in passivation:
    <exArgs count="1">
    <arg name="Bind_SchlrAyId" type="oracle.jbo.domain.Number">
    <![CDATA[1]]>
    </arg>
    </exArgs>
    But then when it reactivates prior to rendering the page, it invariably throws a missing parameter exception and this in the log:
    <ViewUsageHelper><createViewAttributeDefImpls> [7409] *** createViewAttributeDefImpls: oracle.jdbc.driver.OraclePreparedStatementWrapper@1af78e1
    <ViewUsageHelper><createViewAttributeDefImpls> [7410] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
    <ViewUsageHelper><createViewAttributeDefImpls> [7411] ViewUsageHelper.createViewAttributeDefImpls failed...
    <ViewUsageHelper><createViewAttributeDefImpls> [7412] java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    I have worked on this for hours and can't see anything wrong. Like I said, it works fine when not forcing passivation...
    Any help would be appreciated.
    Thanks.
    -Ed

    @Jobinesh - Thanks for the suggestions. I have read all the documentation I can find. Everything works fine without passivation. Everything still breaks with passivation. I have given up on trying to get the bind variable to restore after passivation and am currently just building the query with all values embedded in the query rather than bind variables. This is bad practice but avoids the problem. However, now that I avoided that obstacle, I'm on to the next issue with passivation of this dynamic view object, which is that the current row primary key apparently cannot be reset after activation. I get the following error:
    <Key><parseBytes> [7244] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
    <DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
         at oracle.jbo.Key.parseBytes(Key.java:537)
         at oracle.jbo.Key.<init>(Key.java:179)
         at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
    I've been trying various workarounds for over a day now with no luck. Very frustrating.
    Thanks for trying to help.
    -Ed

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

Maybe you are looking for

  • Auto sync is not working. How can I manually transfer music from my macbook pro iTunes to iphone 5?

    Auto sync is not working. How can I manually transfer music from my macbook pro iTunes to iphone 5? My iMatch is turned on and I can direct downlad my music to the iPhone from the Cloud; however, I want to direct import All of my music from iTunes to

  • ITunes wont open somehting about audio configuration

    okay i updated to 7.2 and it was working fine then yesterday i try and open it and it says this "iTunes cannot run becasue it has detected a problem with your audio configuration" any ideas or suggestions? thx for reading

  • Windows Install fails to detect VSTO 4.0 in Windows machine

    I've to install excel based application developed in VS 2010. Windows installer fails while detecting VSTO in Windows 7/8/8.1. Its perquisites are .Net framework 4.0 client frame work and VSTO 4.0. Even we have installed VSTO manually and re-run our

  • Disappearing Text in PDF

    Hello, Thanks ahead of time for reading this, and for your help. I am in the process of filling out a very important (and, um, large) pdf issued by the IRS, and a very strange thing continues to happen. After I type text into fields (or check boxes),

  • Users unable to access the internet sites

    Hi Everyone, We have users who are able to get the IP address but unable to access any internet sites. I check the trap logs on the WLC RADIUS server 192.168.50.1:1812 failed to respond to request (ID 16) for client 88:53:2e:99:24:b5 / user 'unknown'