Using LOV with bind var as custom attribute?

I have an Portal LOV which uses a bind variable.
Can I use this LOV as a custom attribute? If so, how do I specific the bind variable value?
In the display option of the attribute I tried LOV_NAME(LOV_Bind => 'value'), but the LOV is not applied.

It's been quite a while, but I think I remember trying this and not being able to achieve it. You can use a LOV with a bind variable in a report or in a form, or similar, but there is no way in an item to from specify where to get the bind variable. My suggestion if this is a requirement would be to use a portal form which submits to a stored procedure or pl/sql generated form to gather the attributes and then programmatically create the item using the APIs. Takes a bit of work, but gets you exactly what you described above.
Rgds/Mark M.

Similar Messages

  • Oracle 10g Diff in execution plan query with binding var Vs without

    We recently did 10g upgrade. In 10g, execution plan differs for query with binding var(thru jdbc etc) Vs without it as given below. For query with binding var,
    it chooses poor execution plan(no index is used, full scan is done etc). everything worked fine in 9i. To rectify the problem, we have to hint query with right index,join etc. but i dont like this solution.
    I would rather prefer to correct database to choose right execution path instead of eacy query level. but not sure what causes the issue.
    Does anybody came across this issue? if so, Please share your experiences. Thanks for the help. Do let me know if you need more info.
    1. Query without binding bar:
    select * from test where col1 = :1 and col2 = :2
    1. Query without binding bar:
    select * from test where col1 = 'foo' and col2= 'bar'

    I am not an expert but in my humble opinion it is the developer's responsability to ensure the correct explain plan is used before deploying code to production, if the explain plan returned by the DB is bad, then the use of a hint is perfectly acceptable.
    Check this out: http://lcgapp.cern.ch/project/CondDB/snapshot/performance.html
    Excerpt:
    Bind variable peeking. If an SQL query contains bind variables, the optimal execution plan may depend on the values of those variables. When the Oracle query optimizer chooses the execution plan for such a query, it may indeed look at the values of all bind variables involved: this is known as "bind variable peeking".
    In summary, the execution plan used for a given SQL query cannot be predicted a priori because it depends on the presence and quality of statistics and on the values of bind variables used at the time the query was first executed (hard-parsed). As a consequence of this instability of execution plans, very different performances may be observed for the same SQL query. In COOL, this issue is addressed by adding Oracle hints to the queries, to make sure that the same (good) plan is used in all cases, even with unreliable statistics or unfavourable bind variables.
    Edited by: Rodolfo Ferrari on Jun 3, 2009 9:40 PM

  • Using LOV with Validation on the Numeric Fields results in Error

    Dear JHeadstart Team,
    During my work with lov I encountered another problem. I defined a lov and attached the lov to a numeric field and check the LOV for validation. Now when I use LOV using the LOV button it works fine but when I enter some numbers and then press tab the LOV was not shown correctly and resulted in the following errors and the worst thing is that you can not navigate to any other pages and all try to navigate to other pages results in errors too. When we put the same LOV on a string field (which is not desirable for us) it worked fine.
    It seems to me like a bug. Am I right? Is ther any solution or workaround for this problem?
    Thanks in advance,
    Navid
    16:31:29 DEBUG (LovItemBean) -Cleared value of item HrTrainingCourseSchedulesTitle
    16:31:29 DEBUG (LovItemBean) -Cleared value binding #{bindings.HrTrainingCourseSchedulesTitle.inputValue} of item HrTrainingCourseSchedulesTitle
    16:31:29 ERROR (ApplyRequestValuesPhase) -java.lang.ClassCastException: java.lang.Long
    javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Long
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
         at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
         at oracle.adf.view.faces.component.UIXSelectInput.broadcast(UIXSelectInput.java:215)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:249)
         at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
         at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at com.pooya.controller.jsf.PooyaAuthenticationFilter.doFilter(PooyaAuthenticationFilter.java:256)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         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 oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: java.lang.Long
         at oracle.jheadstart.controller.jsf.bean.LovItemBean.validateWithLov(LovItemBean.java:101)
         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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
         ... 31 more

    Hi Navid,
    We ran into the same bug and have the next workaround for it:
    We extended the JHeadstart class 'LovItemBean' and we have overridden the method 'validateWithLov(...)' with:
      public void validateWithLov(ValueChangeEvent valueChangeEvent)
        Object newValue = valueChangeEvent.getNewValue();
        if(newValue != null && !(newValue instanceof String))
          newValue = newValue.toString();
          ValueChangeEvent newEvent = new ValueChangeEvent(valueChangeEvent.getComponent(), valueChangeEvent.getOldValue(), newValue);
          newEvent.setPhaseId(valueChangeEvent.getPhaseId());
          super.validateWithLov(newEvent);
        else
          super.validateWithLov(valueChangeEvent);
      }Next step is to use a custom template in your JHeaedstart Application Structure file for 'LOV_ITEM_BEAN'. In this custom template you should use your own class as 'managed-bean-class' instead of the default JHeadstart one.
    Now you can safely generate LOV with validation of number fields.
    Maybe something the JHeadstart can pcik up in the next release of JHeadstart :-)
    Hope this helps.
    Pascal

  • Query with bind var created under apex to generate xml data

    Hi all;
    BiP: 10.1.3.4
    Apex: 4
    DB 10G
    Goal: want to generate a report by running a query with bind variables under apex.
    problem: when attempted to create a query under shared components in apex, at the downloading xml data stage, I always get "no data found" eror. Thus I can't save xml data for further report work. This only occurs when bind var involved. I have tticked "incl. session variables" and added the item but to no avail.
    Does anyone know how to do this and get the xml data to recive the bind variable ?
    Thanks.
    lulu

    To get the xml data, sql query has to return something. Why the sql is not returning anything can be better investigated outside the BI Publisher with special tool like SQL Developer or TOAD. There you have to run your query and make it working. One of the steps would be to try the sql without the parameter, see what data it brings back and go from there. One of possibilities why the parameter kills the output may be the NULL values involved, but you need to try the sql outside the BIP first.

  • Custom Titles for charts with Bind vars

    I have seen several posts on tnese pages regarding doing this very thing for a report. I have done this and it worked fine. But doing the same thing on a chart doesn't . Why?
    I have tried many things making use of wwpro_api_parameters functions. Nothing has so far worked. Can anyone please help.
    null

    use the colour wheel to obtain million + colours:     Inspector > Format > Style > Fill

  • Blank drop-downs when using LOV with static VO

    Hello, I am using JDeveloper 11.1.2.3.0
    I have set some attributes to display as LOV. The attributes that are connected with Entity Based VO are fine but those that are connected with Static List VO not. In the second case I am getting drop-downs with blank values on it. Does anyone have any idea why does this happen?
    PS: The application was working fine, but after I restarted JDev I got this error. Now I restarted it again and again but with no result.

    Hi,
    don't see how we can help unless you provide details steps for how you set up the static LOV.
    Frank

  • ADFBC: LOV with bind variable inside Table

    Hi,
    I can't seem to find information on how to use bind variables on LOV's that are inside an af:table.
    Please help.
    Thank you.
    Links that didn't work :
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcquerying.htm#ADFFD345
    http://www.oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    http://groundside.com/blog/DuncanMills.php?title=executewithparams_my_new_best_buddy&more=1&c=1&tb=1&pb=1

    You are not really specific about the actual problem. What are you trying to do?
    Show some peaces of code. Got any errors?
    Timo

  • Can't use LOV with item type "check box" in form

    I have created a LOV that I want to use with a form application in 3.0.9. I need to be able to do multiple choices in this LOV (check box style) in the same query (only queries - users won't be able to update this field)
    When I choose Check box as the item type in the form wizard I am not able to choose the LOV. I have to use combo box, popup or radio group for the LOV choices to appear, but then the query can only query for one value in the LOV at a time.
    Is there a solution to this?

    Hi,
    This feature is not supported as of now. You cannot have multi select LOV for a form field and hence a checkbox cannot have a LOV.
    Thanks,
    Sharmila

  • Error in Dynamic LOV with Bind Variable

    Hi
    I created 2 Dynamic LOV's in which Second one is with a Bind Variable.Then I creted a Form and Attached the LOV's to the form fields.But I am getting the below mentioned error when i choose a value in the First LOV and the Second LOV is not Populated. I tried the same thing with the scott.dept and scott.emp table which is working fine.but when i try the same on my tables it is throwing me error.
    Can Anyone Suggest me what is the problem of these LOVs
    FYI
    1)I am writing SELECT on Views in the LOVs and the views are created on tables of a different of database.
    2)Below Mentioned LINK_TIT is my DB Link.
    Error Message:
    An unexpected error occurred: ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16016)
    Error displaying form : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16408)
    Error displaying block : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16406)
    Error displaying item : ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT (WWV-16404)
    Error ORA-01722: invalid number
    ORA-02063: preceding line from LINK_TIT, displaying DUMMY_FRM_BLEND.DEFAULT.SKU5ID.01, combobox (WWV-16405)
    The preference path does not exist: ORACLE.WEBVIEW.PARAMETERS.16172911255 (WWC-51000)

    Hi Everyone,
    This was a known Issue in Oracle 9i AS Portal.I referred to the
    metalink note ID 174116.1 which talks about the BUG No:1584284.and it gives some workaround to come across the BUG.
    I got my dependent LOV work after changing the NUMBER datatype in the Procedure to VARCHAR2.(Then in the PL i converted the character to number by the SQL function.)
    Regds
    Rajesh Kanna.V

  • Default form value using sql with bind variable

    I wish to create a form based upon a table with a foreign key. I wish to add a field to the form that is an uneditable text field with a default value using sql of 'select name from other_table where other_table_id = ?' where ? is a bind variable defined by a hidden field which is the value of the foreign key identified at runtime. How can this be done?
    null

    I don't think that will work. I have multiple people accessing the Portal at the same time with the same login (or lack of as public will be the most common user). I could set it easily enough as the value is passed to the form by a link object, so I could add it to the before page plsql block and set the value. But I am uncertain how it will behave in a multi-user mutlitasking environment.
    Maybe I should describe what I am looking to accomplish. I want to create a display above a form that will list static details from other tables (i.e. when editing a user's phone number, which is in one table, you want the user to see the person's name, which is in another table, and the form is based upon the phone table) ...
    Just as I am thinking about it, I thought of an idea. I could put some specific code in the before displaying page plsql section to query the database and use htp to output the information for data not in the table the form is based upon. I will try this and see how it works. It would have been nice to have just created a field that is not editable and had a default value, but this should work as well.
    Let me know if you see any problem with this or if you have any better suggestions.
    Thanks for the fast response.

  • Slow performance when using cursor with bind variable

    i'm facing the problem mentioned in the subject.
    whenever i use the bind variable it would take more than 5mins to fetch 157 records, but if i hardcode the value ( not using variable ) it would take only 10sec to fetch 157 records.
    can anyone give me some guide to solve this problem? thank you..
    Code :
    DECLARE
    cursor cur1(l_startdate IN varchar2,l_enddate IN varchar2) IS
    select * from shipment ship where ship.insertion_date >= to_date(l_startdate,'DD-MM-YYYY HH24:MI:SS') and ship.insertion_date < to_date(l_enddate ,'DD-MM-YYYY HH24:MI:SS')
    TYPE shipment_aat IS TABLE OF cur1%ROWTYPE INDEX BY PLS_INTEGER;
    l_shpt shipment_aat;
    limit_in INTEGER := 100;
    BEGIN
    v_startdate := '10-06-2008 14:00:00';
    v_enddate := '10-06-2008 17:00:00';
    OPEN C_shpt(v_startdate,v_enddate);
    LOOP --start shipment loop   
    FETCH C_shpt BULK COLLECT INTO l_shpt LIMIT limit_in;
         FOR indx IN 1 .. l_shpt.COUNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('l_shpt value ' || l_shpt(indx).ship_number || '/' || l_shpt(indx).insertion_date);
    END LOOP;
    EXIT WHEN l_shpt.COUNT < limit_in;
    END LOOP; -- end of shipment loop
    CLOSE cur1;
    END;

    When your query takes too long ...

  • Problem Use Query Bind Parameters with binding

    Hi Developers
    i use JHeadstart 11g TP2
    I want use Lov Group by Query Bind Parameters. when i use simple value like "P_PARENT_ID=10" , Query Lov view By this parameter right but when i use Binding like "P_PARENT_ID=#{bindings.inputtext1.inputValue}" and inputtext1 value is 10 but result is wrong and show me all record , my where clause of my view is (Acc.ID_FK =:P_PARENT_ID OR :P_PARENT_ID is null)
    this method work in Jheadstart 10g but not in 11g
    Regards,
    sanaei

    sanaei,
    Did this really work in 10.1.3 without custom templates?
    Assuming inputtext1 is in your base page, then #{bindings.inputtext1.inputValue} should return null when used as query bind var in the LOV, since the LOV page as its own binding container (stored under request attribute "bindings").
    In R11, we have a cleaner way to pass parameters to an LOV:
    - In the LOV group, define a parameter, for example "parentIdParam"
    - In the LOV group, use the following expression as Query Bind Parameters:
    P_PARENT_ID=#{pageFlowScope.parentIdParam}
    - In the lov item of the base group, add a parameter named "parentIdParam" and set the value to #{bindings.inputtext1.inputValue}
    That should work.
    Steven Davelaar,
    JHeadstart Team.

  • LOV with Criteria problem

    Hi, I'm using JDEV11.1.1.2
    I have a View object used for LOV
    select kod, element, text  <- lov query
           from tableAwith a ViewCriteria that filters the query with bind Var:
    ( KOD  = :kod )   <-- this is the view criteriaI have assinged this lov to a field of another view and set the bindVar to be a static string 'YYY'.
    Everything works as expected, except in one rare case:
    I open the page and without calling the LOV, I enter some existing key in the lov field manually. When I press Enter the following error occurs:
    java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: kod
    If i first open the lov popup and close it - manual entered keys are working as expected. It seems like it needs the lov to be called (initialized) and then I can work with it with manually entering values.
    Is there something i can do to fix this case, because it maybe not so rare for the customer, who knows the codes and does not need to call the lov popup at all.
    Thank you

    Hi, I'm using JDEV11.1.1.2
    I have a View object used for LOV
    select kod, element, text  <- lov query
           from tableAwith a ViewCriteria that filters the query with bind Var:
    ( KOD  = :kod )   <-- this is the view criteriaI have assinged this lov to a field of another view and set the bindVar to be a static string 'YYY'.
    Everything works as expected, except in one rare case:
    I open the page and without calling the LOV, I enter some existing key in the lov field manually. When I press Enter the following error occurs:
    java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: kod
    If i first open the lov popup and close it - manual entered keys are working as expected. It seems like it needs the lov to be called (initialized) and then I can work with it with manually entering values.
    Is there something i can do to fix this case, because it maybe not so rare for the customer, who knows the codes and does not need to call the lov popup at all.
    Thank you

  • Limitation on number of custom attributes visible

    Hi,
    I am using OIM 11g.
    All the custom attributes are visible on the create user form. I am able to see only 8 custom attributes on the modify user form.
    The visible property of all the attributes is set to true. I cannot modify the attribute once its created at the user creation.
    Can someone please help me out?
    Thanks...

    I got it resolved.
    Permissions in the access policies were not enabled for the remaining attributes.

  • Report query with bind variable

    Trying to create a report query for xsl-fo print. For output format I pick "derive from item" then pick the item name from the list, on the next screen, I paste the query with the bind variable. on the next step test query, I always get "data not found" regardless what value I type in. This is the same query that I ran under sql commands without any issues.
    Does anyone run into the same issue as I have when attempted to create a query with bind var ? There is no problem creating a query without bind varibles. . thanks.
    Munshar

    Hi, please did you get any solution to this issue? I am having similar challenge right now.
    select     EMP.DEPTNO as DEPTNO,
         DEPT.DNAME as DNAME,
         EMP.EMPNO as EMPNO,
         EMP.ENAME as ENAME,
         EMP.JOB as JOB,
         EMP.MGR as MGR,
         EMP.HIREDATE as HIREDATE,
         EMP.SAL as SAL
    from     SCOTT.DEPT DEPT,
         SCOTT.EMP EMP
    where EMP.DEPTNO=DEPT.DEPTNO
    and      DEPT.DNAME =upper(:dname)
    This run perfectly in sql developer, toad, and even inside publisher if I login directly to publisher to create report.
    Generating this same query in shared component query builder and testing it returns no data found. If I remove the last line, it works. but with the last line, it return no data found. It seems no one has been able to provide solution to this issue

Maybe you are looking for