One bind variable to multiple ViewObjects

Hi,
I am using JDeveloper 10.1.3 tool.
I can bind the LOV value (e.g. Department LOV) that user selects
and filter the SQL query based on the user LOV selection from ViewObjects(e.g. Employee VO) I created.
The way I did this as follow: (used ADF BC template)
1. Create read only department view Object for LOV (ie. deptVO)
2. Create Employee entity
3. Create updatable employee view object. (i.e. EmpVO)
- Have select statment with bind variable.
(e.g. select employee_id, name, email, department_id
from employees
where department_id = :departmentId
- Create departmentId bind variable.
4. create application module to have these two view objects created. so it can be drag and droped from Data Control Palatte.
5. On JSF JSP page, expand EmpVO | Operations, drag and drop ExecuteWithParams to the page.(with parameter form)
6. Then expand EmpVO | Operations | ExecuteWithParams,
drag and drop departmentId attribute to the parameter form then
choose Single Selections | ADF Select One Choice from the context menu to create LOV.
7. then drag and drop the EmpVO as ADF read only Table to the JSP page.
This works perfectly for one employee VO.
However, if I add another view object (e.g. Job VO where there is column department_id )
to the model, and want to bind same department LOV as the select statement predicate from the view object (e.g. JobVO), How can I achive this?
For example, if the user selects the Marketing department from the LOV,
two ADF read only tables (one for EmpVO and the other is for JobVO) should return only for Marketing department.
How can I bind one LOV to the multiple differnt View objects?
If this is not supported, is there any way I can do this?
Thanks for your help.
John

I just want to say thanks for posting this answer - it helped me tremendously. Without this forum, I'd be much farther behind! Thank you all for your input to this forum!

Similar Messages

  • One Bind Variable used in multiple VOs jdev 11.1.2.3 redhat 5.8

    Hello:
    I have multiple View Objects and each view object needs to use a bind variable. I would like each VO to reference the same bind variable.
    Example: I have 3 VO and in each VO where clause I need something like emp_key = :p_emp_key, but I want only one bind variable used in each VO. Is this possible?
    So I would like to create one drop down list of values for all the employee names and have all the view objects reference the selected value key of the drop down for employees.
    Each VO should reference the same employee selected.
    What is the best way to accomplish this?
    Thanks much.

    Also, you can try the programatic way if it suits your requirement:
    1. for all 3 VO, make them extend a base class
    2. have a common property with relevant getter and setters in the base class - eg. private String myjob
    3. set this varaible from the view(page/screen - button click/dropdown selection etc) using EL
    4. in each VO using groovy to access the set variables like this -> adf.object.viewObject.myjob
    5. call execute query on requried vo

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    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.

  • How to enter more than one bind variable

    Hello,
    i use bind-variables to pass parameters from one application to another through links. On the SQL-Query-Tab it says that i can enter more than one bind-variable, but i don't know how to do it.
    my sql-statement looks like this:
    SELECT column
    FROM schema.table_name
    WHERE v_variable = :bind_variable
    I don't want to put a second bind-variable in the where-clause.
    thank you
    Ralf Schmitt

    Hi Marcel,
    thanks for your help.
    What I want to do is pass a parameter to a report that is not part of the select-statement
    Example: a simple blackboard
    User selects a category and receives a list of items in that category. now i want to pass the category_id AND the category_name.
    The select on category_id produces the item-list, the category_name is shown in the header of the html-page.
    A question to the code you submitted:
    WHERE v_variable in (:bind_variable1, :bind_variable2, :bind_variable3 etc)
    is v_variable an array? How do i select with such a where-clause?
    Thank you,
    Ralf

  • ADF Groovy Expression with bind variable and ResourceBundle

    Now I have ViewObject which have WHERE clause with bind variable.
    This bind variable is for language. Within bind variable I can change Value Type to Expression and into Value: I put +(ResourceBundle.getBundle("model.ModelBundle")).getString("language")+.
    Now if I run Oracle Business Component Browser (on AppModule) this works. In my ModelBundle.properties there is language=1 name-value pair. And with different locale I have different language number.
    Now if I put that ViewObject on one JSF, this bind variable expression does not work any more. Error:
    *oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.util.MissingResourceException, msg=Can't find bundle for base name model.ModelBundle, locale my_locale*
    Any ideas?
    10x
    Zmeda

    The most wierd thing is that, if I make ViewObjectImpl and insert this method
    public String getLanguage() {
    return (ResourceBundle.getBundle("model.ModelBundle")).getString("language");
    and call it in Bind Variable Expression Value: viewObject.getLanguage()
    IT WORKS!
    But why with groovy expression it does not work?
    Zmeda

  • 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

  • Error: Bind Variable Does not Exist

    Hello,
    I am getting a bind error, Although I have only one bind variable, the debug output shows three bind parameters exist. Please let me know why this happens ?
    04/08/11 17:02:50 [5341] SELECT Property.PID, Property.CID, Property.REO, Property.MLS, Property.ADDRESS, Property.CITY, Property.STATE, Property.ZIP, Property.FAX, Property.TEL, Property.STYLE, Property.NROOMS, Property.NBEDS, Property.NBATHS, Property.SQFT, Property.AGE, Property.LPRICE, Property.LDATE, Property.EXPDATE, Property.FCDATE, Property.REDEMPTIONDATE, Property.MORTGAUGER, Property.FNAME, Property.FID, Property.BPOVALUE, Property.BPODATE, Property.WDATE, Property.TRASHOUT, Property.LAWNCARE, Property.REKEYED, Property.VACANCYSTATUS, Property.LOCKBOX, Property.PROPSTATUS, Property.LAGENT, Property.ENTRY, Property.USERID, Property.CONTACTID, Property.TAXID, Property.COBORR, Property.BORCONTACT FROM PROPERTY Property WHERE (Property.USERID = :1)
    04/08/11 17:02:50 [5342] Bind params for ViewObject: PropertyView1
    04/08/11 17:02:50 [5343] Binding param 1: 10097
    04/08/11 17:02:50 [5344] Binding param 2: 10097
    04/08/11 17:02:50 [5345] Binding param 3: 10097
    04/08/11 17:02:50 [5346] ViewObject: PropertyView1 close single-use prepared statements
    04/08/11 17:02:50 [5347] QueryCollection.executeQuery failed...
    04/08/11 17:02:50 [5348] java.sql.SQLException: ORA-01006: bind variable does not exist

    setWhereClauseParams must have been called on this VO to set more than required number of parameters. Could you check for that possibility?

  • Ora-01008 error with bind variable

    Hi,
    We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable. The program returns error in one of the databases but all others are successful. We've checked the column is same in all of them.
    Exception in thread "main" java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01008: not all variables bound
    Could you please advise how to troubleshoot this issue?
    Regards

    We aren't going to be able to help you if you won't post the database code that is giving the error.
    And now we need the Java code that is constructing the query that you are using.
    Your error is saying there is a second variable that you are not providing a value for.
    And you said
    >
    We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable.
    >
    But you are using a string that is 23 characters long
    "a3g34-b13fd-efaie-f83fk"How does 23 go into 20?

  • How do I use bind variables for the SQL statements having IN clause

    SELECT id, name FROM t
    WHERE id in (10,20,30)
    As the IN list will have 'n' number of values, I am not able to specify fixed number of bind
    variables like
    SELECT id, name FROM t
    WHERE id in (?,?,?....)

    452051 wrote:
    I am not able to specify fixed number of bind variablesYou could use collection:
    SQL> create or replace force
      2    type NumList
      3      as
      4        table of number
      5  /
    SQL> select ename from emp where deptno member of NumList(10)
      2  /
    ENAME
    CLARK
    KING
    MILLER
    SQL> select ename from emp where deptno member of NumList(10,20,30)
      2  /
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    ENAME
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> This way you have one bind variable - collection.
    SY.

  • How to use sql "IN" operator with named bind variable in where clause ?

    Can one bind variable be used for the "IN" list ('1','2','3') ?

    rob,
    No worries. Glad it helped. Glad to see also that you're doing things right and trying to use bind variables ;)
    May I suggest adding "SOLVED" to the title of the original post?
    Best,
    John

  • How execute a dynamic statement with a variable number of bind variables

    Hi all.
    I would like to execute SQL statements in a PL/SQL function.
    SQL statements must use bind variable in order to avoid parsing time. But the number of arguments depends on the context. I can have from 10 to several hundreds of arguments (these arguments are used in a 'IN' clause).
    To minimise the number of differents signature (each new signature involve a parsing), the number of argument is rounded.
    My problem is : how to set dynamicaly the bind variables ?
    Cause it is pretty simple to construct dynamicaly the SQL statement, but using an
    " OPEN .... USING var1, var2, ..., varX "
    statement, it is not possible to handle a variable nomber of bind variable.
    I am looking for the best way to do the same thing that it can be done in java/JDBC with the PreparedStatement.setObject(int parameterIndex, Object x).
    I saw the dbms_sql package and bond_variable procedure : is a the good way to do such a thing ?
    Thanks

    If the variation is only values in an IN list, I would suggest using an object type for the bind variable. This lets you have just one bind variable, regardless of how many values are in the IN list.
    The dynamic SQL ends up looking like:
    ' ... where c in (select * from table(:mylist))' using v_list;where v_list is a collection based on a SQL user-defined type that can be populated incrementally, or in one shot from a delimited list of values using a helper function.
    I use this approach all the time in dynamic searches.
    See this link for more details:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061

  • Re-using bind variables in Pro*C

    Using dynamic SQL method 4. Application originally written back in, oh 1999-ish, using Oracle 7. We've upgraded to Oracle 10g. I've looked through the old manuals ( Pro*C Supplement to the ORACLE Precompilers Guide Version 1.5) for an answer to a question and can't find it in the old manuals. I haven't tried looking through the online manuals for the newer version yet, so if the answer is readily available there I apologize.
    The question is, "Can a bind variable be used more than once within a SQL command?"
    Example: find all employees whose first or last name is not Lee.
    SELECT first_name, last_name
    FROM employee
    WHERE first_name <> :criteria1
    AND last_name <> :criteria2;
    In an example like this, both bind variables contains the same value (Lee). Is it still required to have separate bind variables? Or could I re-use a bind variable, like this:
    SELECT first_name, last_name
    FROM employee
    WHERE first_name <> :criteria1
    AND last_name <> :criteria1;
    Obviously, this is a simplified example. In my application, there are some large unioned SQL statements that re-use the user's id over a dozen times. It would be nice to use just one bind variable repeatedly, rather than having ":userid1, :userid2, :userid3, ..., userid12".
    Thanks in advance,
    Darren

    Got it... you mean, do I ever use a bind variable to store the result of a SQL statement (query). Answer is no, the bind variables are always criteria that are used by the SQL. Output is obtained by using FETCH.
    So I ought to be safe then.
    Thank you,
    Darren

  • HELP: VO Bind variable gets lost, VO passivation checked!

    JDEv 10.1.3.0.4 + Struts/ADF
    I have a VO with one bind variable "accountId", this VO is the "root master" of the hierarchy => not a detail of a link.
    I added a method in the VO (that is part of one AM only) to set the bind variable:
      WHERE CLAUSE:
    (Wevent.EVENT_ID = WeventDesign.EVENT_ID) AND (Wevent.ACCOUNT_ID = AccountOwner.ACCOUNT_ID) AND (Wevent.PHOTOGRAPHER_ACCOUNT_ID = AccountPhotoGrapher.ACCOUNT_ID) AND (Wevent.EVENT_STATUS BETWEEN 30 AND 80) AND (Wevent.ACCOUNT_ID = :0)
      Binding Style: Oracle Positional
      private Number accountId = null;
      private Object[] DEFAULT_VALUES = new Object[]{ Constants.NUMBER_ZERO };
      private static int NUM_DEFAULT_VALUES = DEFAULT_VALUES.length;
      public Row setAccountId(Number newAccountId)
        Row row = null;
        if (newAccountId == null)
        this.accountId = null;
        this.clearCache();
        System.out.println(getClass().getName()+".setAccountId no exeqry newAccountId == null");    
        else
          this.accountId = newAccountId;
          row = this.getCurrentRow();
          if(row == null || row.getAttribute("AccountId") == null || !newAccountId.equals(row.getAttribute("AccountId")))  
    // not good account events !!!!
          this.setWhereClauseParam(0,newAccountId);
          System.out.println(getClass().getName()+".setAccountId before exeqry newAccountId: "+newAccountId);    
          this.executeQuery();
    //      System.out.println(getClass().getName()+".setAccountId after exeqry getRowCount(): "+this.getRowCount());    
          row = this.first();
            if (row != null)
            System.out.println(getClass().getName()+".setAccountId after exeqry+first row.getAttribute(AccountId): "+row.getAttribute("AccountId"));            
            else
            System.out.println(getClass().getName()+".setAccountId after exeqry+first row is null => no rows");                    
          else
          System.out.println(getClass().getName()+".setAccountId NO exeqry this.accountId: "+this.accountId+", newAccountId: "+newAccountId+" current is null? "+(this.getCurrentRow() == null));          
          this.accountId = newAccountId;   
          DEFAULT_VALUES[0] = newAccountId;
          System.out.println(getClass().getName()+".setAccountId this.accountId: "+this.accountId+", newAccountId: "+newAccountId+", DEFAULT_VALUES[0]: "+DEFAULT_VALUES[0]);          
        return row;
    In the AMImpl class I added a service method:
      public Row prepareModelForEventAccountOwnerList(Number accountId)
        EventAccountOwnerListExtVOImpl eventAccountOwnerListExtVOImpl = this.getEventAccountOwnerListExtVO1();
        return eventAccountOwnerListExtVOImpl.setAccountId(accountId);
      }When the user logs in his accountId is retrieved and stored in the HttpSession.
    and the service method is called.
    Ok at this point.
    I have a Page that displays the view.
    In the class AccountEventsAction that extends PagingDataForwardAction I have following initializeModelForPage method.
      protected void initializeModelForPage(DataActionContext ctx)
        System.out.println(getClass().getName()+".initializeModelForPage BEGIN "+System.currentTimeMillis());
        WebAccountAM webAccountAM = (WebAccountAM) this.getApplicationModule(WebConstants.AM_WEBACCOUNT,ctx);
        if (webAccountAM == null)
         // return error
         System.out.println(getClass().getName()+".initializeModelForPage webAccountAM not found.");
        else
          UserContainer userContainer = this.getUserContainer(ctx);
          Row row = webAccountAM.prepareModelForEventAccountOwnerList(userContainer.getAccountId());
          if (row != null)
          System.out.println(getClass().getName()+".initializeModelForPage userContainer.getAccountId(): "+userContainer.getAccountId()+", EventId: "+row.getAttribute("EventId")+", current row key: "+row.getKey());             
          else
          System.out.println(getClass().getName()+".initializeModelForPage userContainer.getAccountId(): "+userContainer.getAccountId()+", First row is null? "+(row == null));     
          super.initializeModelForPage(ctx);
        }To my knowledge because this page is accessible only after login and the VO passivation state (+bind vars ..) is yes it shouldn't be necessary?
    FIRST PROBLEM:(non blocking)
    =============
    I noticed in my trace that the VO current row is null when the service method gets called in the initializeModelForPage binding method?
    So the query gets re-exceuted, is this normal??
    SECOND PROBLEM (blocking)
    ================
    At some point the Web app. the frameworks calls the executeQueryForCollection and an exception is thrown as if the bind variable was lost???
    extract:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.SQLStmtException, msg=JBO-27122: SQL error during statement preparation.  Statement: SELECT Wevent.EVENT_ID, ...       
    FROM WEVENT Wevent, WEVENT_DESIGN WeventDesign, ACCOUNT AccountOwner, ACCOUNT AccountPhotoGrapher WHERE (Wevent.EVENT_ID = WeventDesign.EVENT_ID) AND (Wevent.ACCOUNT_ID = AccountOwner.ACCOUNT_ID) AND (Wevent.PHOTOGRAPHER_ACCOUNT_ID = AccountPhotoGrapher.ACCOUNT_ID) AND (Wevent.EVENT_STATUS BETWEEN 30 AND 80) AND (Wevent.ACCOUNT_ID = :0) ORDER BY Wevent.T_MODIFIED
         at oracle.jbo.JboException.<init>(JboException.java:346)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleError(PageLifecycle.java:722)
         at oracle.adf.controller.struts.actions.DataAction.handleError(DataAction.java:257)
         at oracle.adf.controller.struts.actions.DataAction.handleError(DataAction.java:453)
         at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:147)
         at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
         at com.photoswing.webview.actions.BaseDataForwardAction.handleLifecycle(BaseDataForwardAction.java:239)
         at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
         at oracle.adf.controller.v2.struts.actions.DataAction.execute(DataAction.java:104)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:434)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at com.photoswing.filter.LocaleFilter.doFilter(LocaleFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. 
    06/10/13 22:37:15 java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    06/10/13 22:37:15      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)I hope I didn't miss something and I don't have to review all my bind variables setting methods!
    Your help is required and will be appreciated
    Fred

    More info:
    I added a trace in the executeQueryForCollection method of the VO.
    As I said before the binding var is set on login and in initializeModelForPage
    but when the executeQueryForCollection is called by framework later on in the action cycle, it is called without any parameters => bind variables = numUserParams: 0 ??
    trace extract
    com.photoswing.model.site.EventAccountOwnerListExtVOImpl.executeQueryForCollection this.accountId: null, numUserParams: 0, DEFAULT_VALUES[0]: 0
    I suppose that some code must be added so that my bind variables will be part of the passivation process.
    Can you help me with that?
    Thanks for your time.
    Fred
    PS It's my second day on this problem.

  • How to bind variables to a LOV query

    Hi,
    I have a page with a messageLOVInput field. I have attached an external LOV with it. The query attached to the LOVregion has a bind parameter which should be replaced by the logged in Person's Business Group ID.
    I have done all the required LOV Mappings etc for a normal LOV.
    If I hardcode the business group ID and then run the page, its working fine. But if I want to bind the businessgroup id at runtime, I am getting an error saying "all variables not bound"
    I tried the usual method of calling some initMethod in AM from the CO of the external LOV region, and then calling some initQuery in the VO to set the bind parameter, but this doesn't work.
    How do I bind variables at runtime with the LOV VO ?
    Thanks, in advance !!
    -Debojyoty

    Hi Deb,
    Heres what you gotta do.
    By default the query is going to be executed in the EO . In case of a query without any bind variables this works fine. This is because for LOV EO's one doenst' have to explicitly call the the executequery method. In your case, there is one bind variable that needs to be set, before any query is fired, either implicitly or explicitly else you are going to get Bind variable not set exception.
    1. Define an init query method in your EOImpl.
    public void initQuery(String p_param)
    setWhereClause(null);
    setWhereClauseParams(null);
    setWhereClauseParam(0,p_param);
    2. Define a method for initializing the query. In your AM IMPL for the LOV, recieve the EOIMPL and call the initquery method and pass the parameter that you would to base the query upon.
    3. In the CO for the LOV, call the AMimpl Method defined in step 2.
    Let me know if this works ? If you still have problems, I will post some sample code.
    Rgds,
    Venkatesh
    Message was edited by:
    Venkatesh

  • Where clause with Bind Variable in ViewObject

    As per recomendations from Jdev team they say that using Bind varialbles in where clause will improve the performance (Option 1) But it is causing us to create more view objects.
    Example : Lets say we have a View Object EmpVO
    Option 1:
    ViewObject vo=context.getViewObject("EmpVO");
    vo.setWhereClause("EMPNO=?");
    vo.setWhereClauseParam(0,st);
    (or)
    Option 2:
    vo.setWhereClause("EMPNO="+st);
    If we want to use same View Object "EmpVO" in another Action Class
    ViewObject vo1=context.getViewObject("EmpVO");
    vo1.setWhereClause("DEPTNO=?");
    vo1.setWhereClauseParam(0,str);
    It this case it throws an error saying BIND VARIABLE already exits. So we have to make another View Object.
    Where as if we did not use bind variable but used Option 2 approach the same view object can be used in multiple pages.(at the expense of performance as per Jdev team)
    Are we doing something wrong here or are there other ways to use the same view object when using bind variable in where clause.
    Thanks

    I haven't been using BC4J for a while, but I seem to recall that the recommendations are that you don't set the where clause at runtime: You're supposed to define your view with the bind parameter already in it.
    So you'd probably define an EmpsForEmpNoVO and type "EMPNO = ?" in the where box. (There are other ways of finding a single row/entity and one of those may well be more efficient. Perhaps a better example of where you might want a view of employees is WHERE DEPTNO = ?.)
    IIRC, all instances of a particular type of view share the same definition, so you have to be careful if you alter that at runtime. However, I think everything's set up so that you can have many different (and separate) resultsets for a single view (instance) - meaning that it's possible to "run" a view for (e.g.) two different ids. (It's definitely possible to create two different instances of a view from its definition - and the resultsets will definitely be separate then. I think there's a "create" method on the application module; I remember that "find..." always returns the same instance of the view.)
    Hope that's a push in the right direction (since no-one else had replied - and I hope not too much has changed since 9.0.3)....
    Mike.

Maybe you are looking for

  • Getting hyperlink formula from field objects.

    Hi everyone, I'm looking to extend the export to .pdf functionality in order to include hyperlinks. I have already ran some proof of concept programs, and I'm able to export to .pdf and add a hyperlink to a rectangular area of an existing .pdf docume

  • How do i just request a few rows returned?

    Im using toad and working with a very large database, for testing purposes i just want to look at a few rows of results from my query. I thought it was SELECT MAX_ROWS(30) ..... but nope. Whats the sql command to just return a few rows from the query

  • Setting up for Xbox 360

    in the router set up thing under applications and games can someone tell me what to write for each subtab if im trying to get an open NAT for xbox live on an xbox 360? i have a WRT54GX2. Thanks!

  • Cannot install p/shop elements 11 ? incompatible disc

    All attempts to install photoshop elements 11 fail. error (-1). This is said to mean incompatibility due to HSFX files being case sensitive. S/ware downloads OK  on my wife's laptop but she doesn't want it on her machine! Is there a way round this? A

  • About E-mail account!

    Hello, I just got my cousin's used device. It's not a new one. I tried to create an account in the e-mail set-up thing, and it required me to write username and password. Obviously, i had no idea so that i tried to create an account. but it says it a