Depending executewithparams bind variables

Hello.
We have an ADF application with parameter form (executewithparameter parameters).
Into the first parameter, users can input number. The second parameter is a list parameter (select one choice).
We want dependent list. List parameter should show only those values that are valid for value in the first parameter. LOV should be dependent on the first parameter.
First parameter is created with bind variable from a view object query (read-only - with sql).
LOV parameter is created with new view object (ADF select one choice, base data source - variables).
Any idea?
Thanks.
Regards,
Dejan

Hi,
when the first select choice changes its value, you auto submit it (PPR) and in the ValueChange Listener you get the selected value. From here you query the VO of the second list and call ADFFacesContext,getCurrentInstance.addPartialTarget(listComponent2) to refresh it. This approach works since 10.1.3
Frank

Similar Messages

  • Can't create multiple dependent LOVs from the same bind variable

    Hi all,
    I'm having difficulty creating multiple dependent LOVs from queries based on the same bind variable in my JSF application (JDev 10.1.3.1). Basically I have a static LOV in a af:selectOneChoice component from which users select a value which then becomes the bind variable value for two separate queries that generate two different dependent LOV. Having developed the code along the lines of Steve Muench 's blog (http://radio.weblogs.com/0118231/2006/04/03.html#a685), the first dependent LOV works really well. The first dynamic LOV gets refreshed whenever the list from the static LOV changes, and I can execute other queries based on the values selected.
    The problem arises when I want to create the second dynamic/dependent LOV that has the same bind variable based on the same selected value from the static LOV. Here I would also like the functionality whereby the second dynamic LOV is also refreshed after the selected value in the static LOV changes. Thinking that all I had to do was replicate the methodology used in creating the first dependent LOV, I created the second iterator, invokeAction and other binding components in the PageDef. The executable section now looks like the following:
    <iterator id="SelectStaticQueryViewObjIterator"
                  Binds="SelectStaticQueryViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>
    <invokeAction id="refreshDynamicQuery1BindParameter"
                  Binds="ExecuteWithParams1" Refresh="prepareModel"
                  RefreshCondition="#{empty requestScope.VariableChanged}"/>
    <iterator id="SelectDynamicQuery1ViewObjIterator"
                  Binds="SelectDynamicQuery1ViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>
    <invokeAction id="refreshDynamicQuery2BindParameter"
                  Binds="ExecuteWithParams2" Refresh="prepareModel"
                  RefreshCondition="#{empty requestScope.VariableChanged}"/>
    <iterator id="SelectDynamicQuery2ViewObjIterator"
                  Binds="SelectDynamicQuery2ViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>I now have a problem whereby everytime I change the value of the static LOV, multiple HTML components for the same ADF component are being generated (the LOVs are refreshed via PPR). The surprising thing is that this duplicating behaviour applies to all ADF components listed after the first dynamic LOV in the *.jspx source. For example, I have a <af:outputText="Test Text"/> component created after the first dynamic LOV. Each time the value in the static LOV changes, a duplicate HTML component is created. This also applies to the 'related' second dynamic LOV which is bound to a af:selectOneChoice component - multiple dropdown lists are created. I've checked with the browser's Page Source and there are actually multiple html components being generated with their own unique ADF-generated IDs. I've tried all different options for the Referesh and RefreshCondition attibutes in the second invokeAction element but nothing seems to eliminate this issue.
    Any suggestions about how I might create multiple dependent LOVs from the same bind variable that get refreshed when the selected value changes would be greatly appreciated.
    Thanks
    George

    Hi all,
    Just updating the thread on how I've overcome this issue. As it stood the manner in which I was trying to solve my use case, as described above, was creating an absolute mess. Then with a blank sheet of paper I quickly realised that a much simpler solution would be to create a whole series of master-detail VOs and build my components around them. Thankfully I haven't had any issues going down this path as yet.
    Cheers
    George

  • Setting bind variables in dependant LoV's : How?

    Hi
    I'm trying to create an LoV dependant upon the value selected in a previous Lov.
    I have created an LoV with a bind variable which executes correctly when run independantly of a form
    When I attach the loV to a form I get prompted to :-
    "Set the binding(s) for the bind variable(s) defined in the lov"
    How do I do this ?
    All replies gratefully recieved, thanks in advance
    Andy

    Examples of using a bind variable LOV are located in the "Building Portals" manual. On technet, click the Documentation tab, then open the "Building Portals" PDF.
    null

  • Populate a bind variable depending on the previous page.

    Hi,
    How do you populate a bind variable depending on the previous page (where the user is “branching from”)?
    Example.
    Page 10 has a report:
    Select Value1_Desc
    From Table
    Where Value1_ID = :P10_VALUE1_ID
    Page 5 can branch to page 10 and pass along the Value1_Desc from P5_VALUE1_ID into :P10_VALUE1_ID.
    Page 8 can also branch to page 10 with an item value based on the same field, passing Value1_ID from P8_VALUE1_ID into :P10_VALUE1_ID.
    Is there a way to make the report in page 10 accept the proper bind variable value depending on the previous page?
    Thanks
    Matt

    Matt,
    Page 5 can branch to page 10 and pass along the Value1_Desc from P5_VALUE1_ID into :P10_VALUE1_ID.Page 5 can branch to page 10 and pass along the VALUE1_ID from P5_VALUE1_ID into :P10_VALUE1_ID.
    The normal method is to have the branch pass the value in the URL, e.g., the branch from page 5 would specify:
    f?p=&APP_ID.:10:&SESSION.::NO::P10_VALUE1_ID:&P5_VALUE1_ID.
    Scott

  • Repeated rows resulting from executeWithParams on query with bind variable

    hi
    Please consider this example application created using JDeveloper 11.1.1.3.0
    at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.01.zip
    It has a View Object "EmployeesVO" based on a SQL query with a bind variable "EmailBVar".
    The page "findEmployees.jspx" has executeWithParams dropped as an "ADF Parameter Form..." and the "EmployeesVOVI" collection as a table.
    On "EmployeesVOVIIterator" the RangeSize has been modified from the default 25 to 10.
    So, all straightforward stuff.
    A scenario (sc1), running the page "findEmployees.jspx", specifying a value and clicking the "ExecuteWithParams" button results in repeated rows shown in the table, that is the first row (and subsequent rows) are repeated at row 11 (and subsequent rows),
    as can be seen in the screencast at http://screencast.com/t/bn9QvV0qt
    question:
    - (q1) How can the repeated rows in scenario (sc1) be explained/avoided?
    many thanks
    Jan Vervecken

    Thanks for your reply Nick Haralabidis.
    it can be avoided by setting the EmployeesVO Access Mode to Range Paging and setting the Range Size to 10. Indeed, that does seem to avoid the repeating rows.
    Now why you get this behavior when you don't specify Range Paging on the VO I don't know. It could be because: 1) it is a bug - the obvious answer ;) , 2) because setting the RangeSize on the EmployeesVOVIIterator without setting the Access Mode on the EmployeesVO to Range Paging is conflicting - but then again there is no warning or error produced by JDeveloper, 3) ...It does look like unintended behaviour, for a "default approach" like this.
    In documentation section "39.1.5 Efficiently Scrolling Through Large Result Sets Using Range Paging " ...
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadvvo.htm#ADFFD1179
    ... this Range Paging for a View Object seems to be described as an optimization, not as a requirement for functionally correct behaviour.
    - about (q1)
    Another approach that seems to avoid the repeated rows in scenario (sc1) is removing the value for the RangeSize attribute on the iterator, so the RangeSize is not specified.
    Using the modified example application
    at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.02.zip
    ... this can be seen in scenario (sc2) in the screencast at http://screencast.com/t/0bpCo33i8J
    Although, the documentation in section "22.4.2.2 Iterator RangeSize Attribute " ...
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/web_form.htm#ADFFD706
    ... does not seem to mention anything about not specifying the RangeSize attribute, it does say "... You can set it to -1 to have the full record set returned. ...".
    As can be seen in scenario (sc2) the EL expression #{bindings.EmployeesVOVIIterator.rangeSize} resolves to -1 which suggests that not specifying the RangeSize attribute is the same as configuring the RangeSize attribute to -1.
    questions:
    - (q2) What is the preferred way to avoid having "the full record set returned", without having repeated rows as in scenario (sc1)?
    - (q3) Is the default configuration of RangeSize="25" on the iterator intended behaviour (for an interator supporting an executeWithParams action)?
    regards
    Jan

  • Select One Choice attribute' LoV based on two bind variables, best practice

    Hello there,
    I am in the process of learning the ADF 11g, I have following requirement,
    A page must contain a list of school names which is needed to be fetched based on two parameters, the parameters are student information been inserted in the previous page.
    I have defined a read only view "SchoolNamesViewRO", it's query depends on two bind variables :stdDegree and stdCateg.
    added that RO View as a view accessor to the entity to which the name attribute belongs, and then add LoV for the name attribute using the ReadOnly view,
    added the name attribute as Select One Choice to page2,
    and now I need to pass the values of the bind variables of the ReadOnly view,
    the information needed to be passed as the bind variables is inserted in the previous page, I could have the data as bindings attribute values in the page2 definition
    I have implemented the next two appraoches but both resulted in an empty list :
    * added ExecuteWithParams Action to the bindings of the page and then defined an Invoke Action (set refresh condition) in the executable s, set the default values of the parameters to be the attributes values' input value,
    in the trace I code see that the binding fetches correct values as supposed , but the select list appears empty, does the this execution for the query considered to be connected to the list ?
    * added a method to the ReadOnly view Imp java class to set the bind variables, then I define it as a MethodAction in the bindings , and then create an Invoke action for it , also the select is empty,
    if the query been executed with the passed variables, then why the list is empty? is it reading data from another place than the page!
    and what is the best practice to implement that requirement?
    would the solution be : by setting the default value of the bind variables to be some kind of Expression!
    please notice that query execution had the bound variables ( I see in the trace) are set to the correct values.
    would you give some hints or redirect me to a useful link,
    Thanks in advance
    Regards,

    please give me any example using backing bean .for example
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:selectOneChoice label="Label 1" id="soc1" binding="#{Af.l1}"
    autoSubmit="true">
    <af:selectItem label="A" value="1" id="si1"/>
    <af:selectItem label="B" value="2" id="si2"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="Label 2" id="soc2" disabled="#{Af.l1=='2'}"
    partialTriggers="soc1">
    <af:selectItem label="C" value="3" id="si3"/>
    <af:selectItem label="D" value="4" id="si4"/>
    </af:selectOneChoice>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    package a;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class A {
    private RichSelectOneChoice l1;
    public A() {
    public void setL1(RichSelectOneChoice l1) {
    this.l1 = l1;
    public RichSelectOneChoice getL1() {
    return l1;
    is there any mistake

  • 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

  • How to get binding variables from request

    We are trying to use html-db to develop an application which need to get values from user request to use in the queries, i.e. we will have pages depend on several binding variables and the value of these variables will be provided by the user through get/post request. Because the request will be initialed by another application so to use a form to collect the values is not an option.
    I am a html-db newbie. Does anyone here know how to do that?

    you're right in thinking this is a bit of a newbie html db question. it's a pretty straightforward matter to set up a report in html db that runs off of bind variables that can be set from a URL. you can see a pretty simple example on the first page of our "Sample Application" that's available to install into your workspace. try taking a look at that to see what i mean. you can install the Sample Application by clicking the "Review Demonstration Applications" link that's available right after logging into htmldb.oracle.com. that resulting screen lets you create (or re-create) the Sample App in your workspace. once it's installed, take a look at how the report on page 1 calls the first report on page 201. that report on 201 is dependent on a bind variable, :P202_CATEGORY, that's set from the URL. this particular URL is generated from the report on page 1, but it could just as easily have been generated from your other application. when you look at this example, the two key points to pay attention to are the 1) syntax used in the URL to set the bind variable (which is explained in our online help at http://htmldb.oracle.com/i/doc/mvl_fund005.htm#sthref357) and 2)the way in which that bind variable is referenced in the first sql query region on page 201. take a look at those when you get a chance, and let us know if you have further questions.
    thanks,
    raj

  • Bind Variable in SELECT statement and get the value  in PL/SQL block

    Hi All,
    I would like  pass bind variable in SELECT statement and get the value of the column in Dynamic SQL
    Please seee below
    I want to get the below value
    Expected result:
    select  distinct empno ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    100, HR
    select  distinct ename ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    TEST, HR
    select  distinct loc ,pr.dept   from emp pr, dept ps where   ps.dept like '%IT'  and pr.empno =100
    NYC, HR
    Using the below block I am getting column names only not the value of the column. I need to pass that value(TEST,NYC..) into l_col_val variable
    Please suggest
    ----- TABLE LIST
    CREATE TABLE EMP(
    EMPNO NUMBER,
    ENAME VARCHAR2(255),
    DEPT VARCHAR2(255),
    LOC    VARCHAR2(255)
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (100,'TEST','HR','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (200,'TEST1','IT','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (300,'TEST2','MR','NYC');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (400,'TEST3','HR','DTR');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (500,'TEST4','HR','DAL');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (600,'TEST5','IT','ATL');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (700,'TEST6','IT','BOS');
    INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (800,'TEST7','HR','NYC');
    COMMIT;
    CREATE TABLE COLUMNAMES(
    COLUMNAME VARCHAR2(255)
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('EMPNO');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('ENAME');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('DEPT');
    INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('LOC');
    COMMIT;
    CREATE TABLE DEPT(
    DEPT VARCHAR2(255),
    DNAME VARCHAR2(255)
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('HR','HUMAN RESOURCE');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('MR','MARKETING');
    INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
    COMMIT;
    PL/SQL BLOCK
    DECLARE
      TYPE EMPCurTyp  IS REF CURSOR;
      v_EMP_cursor    EMPCurTyp;
      l_col_val           EMP.ENAME%type;
      l_ENAME_val       EMP.ENAME%type;
    l_col_ddl varchar2(4000);
    l_col_name varchar2(60);
    l_tab_name varchar2(60);
    l_empno number ;
    b_l_col_name VARCHAR2(255);
    b_l_empno NUMBER;
    begin
    for rec00 in (
    select EMPNO aa from  EMP
    loop
    l_empno := rec00.aa;
    for rec in (select COLUMNAME as column_name  from  columnames
    loop
    l_col_name := rec.column_name;
    begin
      l_col_val :=null;
       l_col_ddl := 'select  distinct :b_l_col_name ,pr.dept ' ||'  from emp pr, dept ps where   ps.dept like ''%IT'' '||' and pr.empno =:b_l_empno';
       dbms_output.put_line('DDL ...'||l_col_ddl);
       OPEN v_EMP_cursor FOR l_col_ddl USING l_col_name, l_empno;
    LOOP
        l_col_val :=null;
        FETCH v_EMP_cursor INTO l_col_val,l_ename_val;
        EXIT WHEN v_EMP_cursor%NOTFOUND;
          dbms_output.put_line('l_col_name='||l_col_name ||'  empno ='||l_empno);
       END LOOP;
    CLOSE v_EMP_cursor;
    END;
    END LOOP;
    END LOOP;
    END;

    user1758353 wrote:
    Thanks Billy, Would you be able to suggest any other faster method to load the data into table. Thanks,
    As Mark responded - it all depends on the actual data to load, structure and source/origin. On my busiest database, I am loading on average 30,000 rows every second from data in external files.
    However, the data structures are just that - structured. Logical.
    Having a data structure with 100's of fields (columns in a SQL table), raise all kinds of questions about how sane that structure is, and what impact it will have on a physical data model implementation.
    There is a gross misunderstanding by many when it comes to performance and scalability. The prime factor that determines performance is not how well you code, what tools/language you use, the h/w your c ode runs on, or anything like that. The prime factor that determines perform is the design of the data model - as it determines the complexity/ease to use the data model, and the amount of I/O (the slowest of all db operations) needed to effectively use the data model.

  • How to substitute a bind variable for a IN condition?

    Dynamically I am setting the WHERE condition for one of my blocks using SET_BLOCK_PROPERTY Built in. The condition that I am attaching has two IN conditons..
    For Eg.,
    contracts_tbl.status_col IN ('NEW', 'OLD', 'EXPIRED', 'OPEN')
    AND contracts_tbl.id_col IN (1, 2, 3, 4)
    The number of choices in the IN condition will vary depending upon the user choice in my screen. Because of this the parsed SQL state is could not be shared and multiple of these are getting created in shared pool. To avoid this I would like to use bind variables.
    There are two ways I am trying to do this..
    1. Generating one bind variable for each value. i.e.,
    contracts_tbl.status_cod IN (:global.var1, :global.var2,
    :global.var3)
    Now this could result it memory error if no. of choices exceeds the avilable memory. Also its a tedious task to purge the variables after querying the block. Also because of multiple IN conditions, the chances of different set of selections are possible and then again sharing will be minimal.
    2. The second method is to set the one bind variable for each IN condition. i.e.,
    :GLOBAL.Var1 := '( 'NEW', 'OLD', 'EXPIRED', 'OPEN' )';
    :GLOBAL.Var2 := '(1, 2, 3)';
    contracts_tbl.status_col IN :GLOBAL.Var1
    AND contracts_tbl.id_col IN :GLOBAL.Var2
    In this case, forms is not querying as the IN condition takes the global variable value as one string and the query returns no rows though there are plenty available for each status. Also any NUMBER type condtions erroring out as the , and ( are invalid numerals.
    Q: Is there anyway you can make this work? or Is there any other better method to substitute bind variables in place to avoid creating new set of statements for each query in the shared pool?
    Your suggestions and pointers are higly appreciated. Please respond immediately as this is a P1.
    Thanks,
    -- Raam.

    2. The second method is to set the one bind variable for each >>IN condition. i.e.,
    :GLOBAL.Var1 := '( 'NEW', 'OLD', 'EXPIRED', 'OPEN' )';
    :GLOBAL.Var2 := '(1, 2, 3)';
    contracts_tbl.status_col IN :GLOBAL.Var1
    AND contracts_tbl.id_col IN :GLOBAL.Var2 This method should work - not sure if you put exact syntax in or not but your first assignment would cause a problem as everywhere you want one ' mark you would have to put two so that it does not close your quoted string
    Try the following syntax:
    :GLOBAL.Var1 := '( ''NEW'', ''OLD'', ''EXPIRED'', ''OPEN'' )';
    :GLOBAL.Var2 := '(1, 2, 3)';
    SET_BLOCK_PROPERTY('blk name',
    default_where,
    'contracts_tbl.status_col IN ' || :GLOBAL.Var1
    || ' AND contracts_tbl.id_col IN ' ||
    :GLOBAL.Var2);
    Hope this helps,
    Candace Stover
    Forms Product Management

  • Bind Variable : required - no message, not required - error

    hi
    Please consider the example application created using JDeveloper 11.1.1.6.0
    at http://www.consideringred.com/files/oracle/2012/RequiredOrNotBVarApp-v0.01.zip
    It has these View Objects defined
    - EmployeesReqNoValueBVarVO which has a required Bind Variable, and where clause "last_name like '%' || :LastNameBVar || '%'"
    - EmployeesNotReqNoValueBVarVO which has a NOT required Bind Variable, and where clause "(:LastNameBVar is null or last_name like '%' || :LastNameBVar || '%')"
    The Bind Variable in both View Objects does NOT have a value (no default value, not programmatically set, not entered by the user, ...).
    This "no value set" aspect could be the result of a "development error", but the resulting observed behaviour is at least "peculiar".
    - scenario (sc1) : run "try tryEmployeesReqNoValueBVarVO", see a table filled with rows and NO message about the required Bind Variable
    - scenario (sc2) : run "try tryEmployeesNotReqNoValueBVarVO", see "No data to display." in the table and the "Missing IN or OUT parameter at index:: 1" error for the NOT required Bind Variable for a where clause that can deal with null values
    - question (q1) How can be explained that scenario (sc1) does not result in an error message about the required Bind Variable (and scenario (sc2) does result in an error message about the NOT required Bind Variable)?
    - question (q2) What does the "Required" checkbox for a Bind Variable really mean for Bind Variables used in a where clause of a View Object?
    If the described behaviour can be reproduced (using RequiredOrNotBVarApp-v0.01.zip), confirmations are welcome.
    (Aspects of these scenario's could be related to forum thread "Bind variable required/not required: strange behaviour".)
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    Frank Nimphius wrote:
    ... your query actually is dependent on the existence of the bind variable because the bind variable is used in the where clause part. ...Sure, and the Bind Variable does exist (in both (sc1) and (sc2)).
    ... This has nothing to do with whether the bind variable value is checked for NULL and if the value it contains is NULL performs an "all you can eat" type of query. Because the existing, NOT required Bind Variable has not been given a value in scenario (sc2), the check for NULL only makes more explicit that NULL is a valid value for the SQL statement.
    ... Non required bind variables are used in the context of view criteria to avoid missing IN or OUT parameters. ...The "Required" checkbox for a Bind Variable is also available/enabled when the Bind Variable is not used in a View Criteria (in both (sc1) and (sc2)).
    ... In the case of a view criteria, the VO query may be executed without the view criteria applied and for this reason should not fail only because the defined bind variable is not provided. ...No View Criteria in the scenario's (sc1) and (sc2) I descirbe.
    ... If you run the query in the tester, you get
    (java.sql.SQLException) Missing IN or OUT parameter at index:: 1
    and no query is executed at all for EmployeesNotReqNoValueBVarVOSure, that matches scenario (sc2), but the Bind Variable can be configured as NOT required, how can it be missing?
    The JDeveloper help page "Create or Edit Bind Variables Dialog - Variable Page" says:
    "... Alternatively, you can use the SQL Statement page of the Edit View Objects dialog to enter a parameterized WHERE clause. Note that the bind variables you enter in a parameterized SQL WHERE clause will require a valid value at runtime or a runtime exception error will be thrown. ..."
    So, null as a valid value, seems to explain the behaviour in scenario (sc1).
    "... In contrast, when you create a view criteria filter condition that references a named bind variable, you can specify whether the value is required or optional. ..."
    But, the "Required" checkbox is also available (to uncheck) for Bind Variables that are not used in a View Criteria.
    Specifically for the "Required" checkbox the help page says : "... Select if you want to make the value of a name bind variable required for any usage the references the named bind variable. For example, when the value is required (default), all view criteria items that reference the named bind variable will fail to execute unless a valid value is supplied at runtime. Alternatively, you can leave the value not required and use the Create View Criteria dialog to specify whether or not individual view criteria items require the value. ..."
    Again, the focus is on View Criteria, although it can also be unchecked (configuring as NOT Required) for Bind Variables that are not used in a View Criteria (which does not seem to be something you should do).
    But, still, there is a perspective here that makes this possibly very confusing:
    - a View Object where clause with a required Bind Variable, no value set --> results in rows, and NO message about a missing value
    - a View Object where clause with a NOT required Bind Variable, no value set --> results in no rows, and a message about a missing value
    regards
    Jan

  • Decode using bind variable in SQL

    I have decode statement in my SQL query which is used to define the VO object. I want to select a column depending on the value entered for the bind variable :1. dont know how to implement this in OAF - any pointers will be appreciated.
    decode(:1,'XO2C_CUST_SERV_REP',XO2C_CUST_SERV_REP,'XO2C_ACCOUNT_MGR',XO2C_ACCOUNT_MGR,'XO2C_CTS_ENGINEER',XO2C_CTS_ENGINEER ) "contact names"
    Thanks!!

    I have decode statement in my sql for the VO and the VO is executed when the user clicks the GO button(user initiated search and over-riding the default Go button).
    When I click the Go button , I am calling a method called Uneditable in my AM which appends the decode variable using the whereclause append but it is failing with an exception "java.sql.SQLException: Missing IN or OUT parameter at index:: 1". Can someone let me know if I am doing anything indifferently which is causing the program/sql query to fail.
    Binding style of the VO is "Oracle Named" - is this causing the problem?
    ProcessFormRequest:
    =============
    if ("ClickGo".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    System.out.println("Go Button pressed>> "+am);
    OATableBean table = (OATableBean) webBean.findChildRecursive("USSContactMainVO1");
    System.out.println("before QueryData");
    //table.queryData(pageContext,false);
    System.out.println("before Boolean executeQry");
    Boolean executeQuery = BooleanUtils.getBoolean(false);
    System.out.println("Get PartyName");
    String v_PartyName = pageContext.getParameter("xxPartyName");
    System.out.println("Get SalesContactQry");
    String v_SalesContact = pageContext.getParameter("SalesContact_qry");
    System.out.println("Party Name :" + v_PartyName + " Sales contact:" + v_SalesContact);
    Serializable[] parameters = {v_PartyName, v_SalesContact,executeQuery };
    Class[] paramTypes = { String.class, String.class, Boolean.class };
    am.invokeMethod("uneditable",parameters,paramTypes);
    Uneditable(AM)
    =========
    public void uneditable(String v_PartyName, String v_SalesContact,
    Boolean executeQuery){
    System.out.println("Im in uneditable..to call VO");
    USSContactMainVOImpl vo1= getUSSContactMainVO1();
    String Voqry =vo1.getQuery();
    //System.out.println("Query is :"+ Voqry);
    StringBuffer whereClause = new StringBuffer(100);
    Vector parameters = new Vector(3);
    int clauseCount = 0;
    int bindCount = 0;
    System.out.println("debug1");
    vo1.setWhereClauseParams(null); // Always reset
    System.out.println("check the params");
    if ((v_SalesContact != null) && (!("".equals(v_SalesContact.trim()))))
    System.out.println("Sales:"+v_SalesContact);
    whereClause.append(v_SalesContact);
    System.out.println("bindcount");
    whereClause.append(++bindCount);
    clauseCount++;
    System.out.println("setWhereclas");
    vo1.setWhereClause(whereClause.toString());
    System.out.println("setWhereclasParam");
    vo1.setWhereClauseParams(null);
    System.out.println("setWhereclasParam-2");
    vo1.setWhereClauseParam(0,v_SalesContact);
    if ((v_PartyName != null) && (!("".equals(v_PartyName.trim()))))
    whereClause.append(" Party_Name like :");
    whereClause.append(++bindCount);
    clauseCount++;
    vo1.setWhereClause(whereClause.toString());
    vo1.setWhereClauseParams(null);
    //vo1.setWhereClauseParam(0,v_PartyName);
    vo1.setWhereClauseParam(1,v_PartyName);
    System.out.println("Query is :" + vo1.getQuery()); //prints this debug msg but fails while executnig the vo
    vo1.executeQuery();
    Row[] rows1=vo1.getAllRowsInRange();
    USSContactMainVORowImpl row = null;
    for (int i = 0; i < rows1.length; i++)
    System.out.println(" Rows Found "+i);
    row = (USSContactMainVORowImpl)rows1;
    row.setAttribute("CTSEngineer_TR",Boolean.FALSE);
    //end of uneditable
    It appends the 2nd parameter and prints System.out.println("Query is :" + vo1.getQuery()) without any issues but think fails when trying to execute the VO.
    Error Stack :
    =======
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT hp.party_name,hp.party_number registry_id, hps.party_site_number Site_Number, hca.account_number,
    hca.account_name acc_desc,
    hl.address1
    || ''
    || hl.city
    || ''
    || hl.postal_code
    || ''
    || hl.state "Address",
    xagv.xo2c_entering_unit "Entering_Unit",
    DECODE(hou.Short_code,'USS CA OU','CA','USS USA OU','US') "Operating_Unit",DECODE('.',null,null) "CTS", DECODE(:1,'Customer Service Rep',XO2C_CUST_SERV_REP,'Account Manager',XO2C_ACCOUNT_MGR,'CTS Engineer',XO2C_CTS_ENGINEER ) "Contact Names" FROM hz_parties hp,
    hz_party_sites hps,
    hz_cust_accounts hca,
    hz_cust_acct_sites_all hcs,
    hz_locations hl,
    xo2c_ship_to_sales_o_agv xagv,
    hr_operating_units hou
    WHERE 1 = 1
    AND hp.party_id = hps.party_id
    AND hp.party_id = hca.party_id
    AND hcs.party_site_id = hps.party_site_id
    AND hca.cust_account_id = hcs.cust_account_id
    AND hps.location_id = hl.location_id
    AND hcs.status = 'A'
    AND xagv.party_site_id = hps.party_site_id
    AND xagv.party_site_id = hcs.party_site_id
    AND hou.ORGANIZATION_ID=hcs.ORG_ID) QRSLT WHERE (CTS Engineer1 Party_Name like :2)
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(Unknown Source)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuss.oracle.apps.xo2c.contactmaintenance.webui.USSContactMainCO.processFormRequest(USSContactMainCO.java:105)
         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.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.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.form.OAFormBean.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)
    ## 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:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         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:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at xxuss.oracle.apps.xo2c.contactmaintenance.server.USSContactMainAMImpl.uneditable(USSContactMainAMImpl.java:244)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuss.oracle.apps.xo2c.contactmaintenance.webui.USSContactMainCO.processFormRequest(USSContactMainCO.java:105)
         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.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.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.form.OAFormBean.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:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         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:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(Unknown Source)
         at xxuss.oracle.apps.xo2c.contactmaintenance.server.USSContactMainAMImpl.uneditable(USSContactMainAMImpl.java:244)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuss.oracle.apps.xo2c.contactmaintenance.webui.USSContactMainCO.processFormRequest(USSContactMainCO.java:105)
         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.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.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.form.OAFormBean.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)
    Edited by: MyOAF on Jan 14, 2010 11:03 PM

  • How to find out if a SQL is using a bind variable or not?

    In order to make a SQL use consistent execution plan, I want to create a profile for a SQL. But I need to know if a SQL is using bind variable or not to create a profile for all the same SQLs except the literal value. How can I do that?
    Thanks in advance

    You can tell if an SQL statement uses a bind variable by looking at the SQL statement.
    If you look in the program that submits the SQL statement you can see how it constructs, prepares, and executes the statement.
    If you are just looking at the SQL in the shared pool then depending on how the statement is written and the setting of database parameters like cursor sharing then it can be more difficult but if you see a constant (actual value) that is a constant. A bind variable would appear as a name in the where clause where that name does not exist any of the tables referenced in the query. Note it is technically possible to create pl/sql variables with the same name as columns in the query but that is poor coding and leads to issues.
    Note - To Oracle two versions of the otherwise same query where one has a constant and the other has a bind variable are not the same query and often produce different plans. This is a common error made by developers new to Oracle when using explain plan. To explain a query that uses bind variables place a ":" in front of the variable name in the SQL submitted to explain plan.
    HTH -- Mark D Powell --

  • How to set a bind variable across the pages in a report

    I want to create a portal report where data will come from a table for a date range for a week.
    For e.g select event_date,last_name, event_name
    from RESOURCES
    where event_date between trunc(to_date(:curr_date,'DD-MON-RRRR'))
    and trunc(to_date(:curr_date,'DD-MON-RRRR')+ 7)
    The :curr_date is defined as a bind variable whose default value is sysdate.
    Now, when we run the report for the first time, it takes the :curr_date as
    sysdate and prints the report.
    I have two buttons in the report output like "previous week" and "next week".
    If someone presses previous week, the same report should run with curr_date
    as sysdate-7 and if someone presses next week, the report should run with
    curr_date as sysdate +7 and also the :curr_date sets to sysdate - 7 or sysdate + 7
    depending on the button pressed.
    Problem:
    How do I set the value of curr_date if someone presses any of
    previous week/next week.
    null

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • Af:iterator and view accessors with bind variables

    I have a page with an af:iterator where I list up each row in a form layout. On each row there are 2 SelectOneChoice items where the current value is provided by the row. The 2 LOVs are Master-Detail-LOVs. The value of the first one restricts the values of the second one.
    Each LOV is represented by a LOV view object in a shared application module. The view object for the second LOV contains a view criteria with a selection on the column where the value is provided by the first LOV. The value for the restriction is passed via Bind Variable.
    <af:iterator id="i_images" value="#{bindings.Image.collectionModel}" var="row" rows="0" varStatus="vs">
    <af:selectOneChoice value="#{row.bindings.Master.inputValue}" label="#{bindings.Master.label}" id="soc_master" autoSubmit="true">
    <f:selectItems value="#{row.bindings.Master.items}"
    id="si3"/>
    </af:selectOneChoice>
    <af:selectOneChoice value="#{row.bindings.Detail.inputValue}" label="#{bindings.Detail.label}" id="soc2" partialTriggers="soc_master">
    <f:selectItems value="#{row.bindings.Detail.items}"
    id="si2"/>
    </af:selectOneChoice>
    The view accessor for both LOVs have the settings:
    Row Level Bind Values = true
    SharedInstance = false
    BTW: If I modify one the two view accessor the value for Row Level Bind Values disappear.
    The value for the bind variable on the view accessor is "Master" like the name of the column.
    On loading the page for the first time the LOVs and the values are properly resolved. The master LOV provides the list with all values and the Detail LOV is restricted corresponding the value of the Master LOV. Upon changing the value of the Master LOV the Detail LOV is reloaded, because of the partial trigger, but now the Detail LOV contains all the values as if now View Criteria has been provided.
    We implemented this scenario in an af:query and it worked fine. Are there any restrictions for View Accessors when using an af:iterator??
    Any help is appreciated.
    Thanks,
    Thomas
    P.S.: We're using JDeveloper 11.1.1.4.0
    Edited by: thomas.matzke on Apr 20, 2011 10:07 PM

    Hi Thomas,
    You may be hitting an error that is discussed in the following blog: http://andrejusb.blogspot.com/2011/03/adf-bc-dependent-lov-11g-ps2ps3-bug-and.html
    Hope this helps!
    Russell

Maybe you are looking for

  • How do I synch two icloud accounts

    When I got my phone, I created a cloud account.  I transferred this to my daughter's iPod when she got it so that I could remain in charge of downloads, etc.  Since then, she's created a new account on her phone and now wants me to transfer music to

  • Can I use an external hard drive on my iPad 3

    Is there anyway I can use an external hard drive on my iPad 3, as I have lot of work I need to save.

  • WCS Report to find b vs g clients?

    Recent discussion on the Educause wireless-lan email list ( http://listserv.educause.edu/cgi-bin/wa.exe?A0=WIRELESS-LAN ) has suggested that many people are getting much better thruput on their 2.4 GHz networks by dropping support for the "b" data ra

  • Shared Folders - User Accounts

    HELP! I was having some problems with some software so Apple support had me create a new User profile (testing) and put my files into a shared folder. I signed on with the new User account (testing) and the software worked. But then I realized that I

  • TS1702 OS X MOUNTAIN LION WONT DOWNLOAD

    Just as the title says really. Its been downloading for 48 hours and the app store 'purchases' just says 'waiting ...' The 'pause' button is blanked out as well. Any ideas please and there appears to be no free help line to call even though its cost