Make List of Values for Required Bind Variables

In the SQL query for my View Object, I have a bind variable, which I set to "required". In the search form resulting from a View Criteria, a textbox shows up asking the user for the value of that variable. Is there a way to make it a List of Values instead?

Hi WV,
Create a transient attribute in your VO that contains the LOV and then set the value of your bind variable to point to this new transient attribute. Also here is another approach
https://blogs.oracle.com/shay/entry/adf_query_with_parameters_and
Let us know how it goes.
-Juan Camilo

Similar Messages

  • How to use SYSDATE as a default value of a bind variable in a query report?

    Hi,
    I want to use SYSDATE as default value for a bind variable in Query based report.
    I don't see any way to do it, someone helps?
    Thanks a lot.
    Paulo.

    You can aslo use #sysdate directly.
    Hi,
    The way I'm doing in my report is, I have a database function (f_ret_sysdate) with the following code
    create function f_ret_sysdate return varchar2
    begin
    return to_char(sysdate,'mm/dd/yyyy');
    end;
    Now, in the 'Customization Form Display Options' section of the report I'm calling this function as #f_ret_sysdate in the default value field of corresponding bind variable to display SYSDATE with the format.
    Hope this helps!...
    -Krishnamurthy

  • Invalid Identifier for a bind variable

    I am running a sql query and am using bind variables for dates. Running the querry and after putting values for the bind variable I get a message invalid identifier. Could any one help me and tell me what I am doing wrong.
    1 SELECT D.NAME_LAST||', '||D.NAME_FIRST DEBTOR,
    2 F.CDCS_NBR,
    3 F.CDCS_SEQ,
    4 F.POSTING_DATE,
    5 F.PAYMENT_AMOUNT,
    6 ( GREATEST ( NVL ( F.ACCRUED_INT_CAP, 0 ), NVL ( F.ACCRUED_INTEREST, 0 ) )
    7 + NVL ( F.ACCRUED_FINE_INTEREST, 0 ) )
    8 ACCRUED_INT_CAP,
    9 DECODE(CLASS,'V', RUN_INTEREST,'R',(RUN_FINE_INTEREST + RUN_INT_CAP)) RUN_INTEREST
    10 FROM TA_DEBT_DEBTOR_LIAB_VW D,
    11 TA_FINANCE F
    12 WHERE F.POSTING_DATE BETWEEN TO_DATE(&A, 'DD-MON-YYYY') AND
    13 TO_DATE(&B, 'DD-MON-YYYY')
    14 AND
    15 F.FINANCE_CODE = 'PMNT'
    16 AND F.PAYMENT_AMOUNT <
    17 ( GREATEST ( NVL ( F.ACCRUED_INT_CAP, 0 ), NVL ( F.ACCRUED_INTEREST, 0 ) )
    18 + NVL ( F.ACCRUED_FINE_INTEREST, 0 ) )
    19 AND F.DEBTORID = D.DEBTORID
    20 AND F.CDCS_NBR = D.CDCS_NBR
    21 AND F.CDCS_SEQ = D.CDCS_SEQ
    22* ORDER BY D.NAME_LAST, D.NAME_FIRST
    SQL> /
    Enter value for a: 10-JAN-2003
    old 12: WHERE F.POSTING_DATE BETWEEN TO_DATE(&A, 'DD-MON-YYYY') AND
    new 12: WHERE F.POSTING_DATE BETWEEN TO_DATE(10-JAN-2003, 'DD-MON-YYYY') AND
    Enter value for b: 10-JUN-2006
    old 13: TO_DATE(&B, 'DD-MON-YYYY')
    new 13: TO_DATE(10-JUN-2006, 'DD-MON-YYYY')
    TO_DATE(10-JUN-2006, 'DD-MON-YYYY')
    ERROR at line 13:
    ORA-00904: "JUN": invalid identifier

    Replace this line...
    12 WHERE F.POSTING_DATE BETWEEN TO_DATE(&A, 'DD-MON-YYYY') AND
    with...
    12 WHERE F.POSTING_DATE BETWEEN TO_DATE('&A', 'DD-MON-YYYY') AND

  • How to fix different execution plan for different bind variable values?

    Please find the below query. The execution plan is fine. The problem That I am facing is in some cases for different bind variable values execution plan gets changed and degrades performance. I have used 6 tables here and all of the tables have histogram on all columns. Database version is Oracle 10g and the value of method_opt is 'For all columns size auto'
    SELECT l.LineNumber INTO :b0
    FROM Lines l ,LineVersions lv ,Statuses s
    WHERE (((((((((((l.serviceContractId=:b1 AND l.LineId<>:b2)
    AND lv.LineId=l.LineId) AND lv.StatusId=s.StatusId)
    AND s.Code IN ('EPR','ERE','EEP','ERP','PRP','PRD','AAC'))
    AND NOT (s.CODE='AAC' AND lv.activeto<TO_DATE(:b3,:b4)))
    AND lv.EquipmentDetailId=:b5) AND lv.RouteDetailId=:b6)
    AND (lv.cargoDetailId=:b7 OR lv.cargoDetailId IN
    (SELECT i_cd1.cargoDetailId
    FROM CargoDetails i_cd1 ,CargoDetails i_cd2 ,CargoCommodities i_cc1 ,
    CargoCommodities i_cc2 WHERE
    ((((((i_cd2.cargoDetailId=:b7 AND i_cd1.cargoDetailId<>:b7)
    AND i_cd1.ServiceContractId=:b1) AND i_cd1.cargoTypeId=i_cd2.cargoTypeId)
    AND i_cc1.cargoDetailId=i_cd1.cargoDetailId)
    AND i_cc2.cargoDetailId=i_cd2.cargoDetailId)
    AND i_cc1.commodityId=i_cc2.commodityId))))
    AND ((lv.customerGroupId IS NULL AND :b11=0) OR lv.customerGroupId IN
    (SELECT cgm1.customerGroupId
    FROM CustomerGroupMembers cgm1 ,CustomerGroupMembers cgm2 ,CustomerGroups cg1
    WHERE (((cgm2.customerGroupId=:b11 AND cgm1.customerNoId=cgm2.customerNoId)
    AND cg1.CustomerGroupId=cgm1.CustomerGroupId)
    AND cg1.ServiceContractId=l.ServiceContractId)))) AND lv.linetype='C')
    AND ROWNUM=1)
    After searching in several blogs I have found the below solutions. Please see it and let me know it is correct or not
    Solution 1:-Get rid of histogram that does nothing but messes up execution plan by giving below command
    exec dbms_stats.gather_table_stats(owner, tablename, method_opt => 'for all columns size 1', cascade => true);
    As 6 tables are there I need to execute above command 6 times.
    Solution 2:- Use stored outline. Not sure how to get the best execution plan.
    I am looking for answers ASAP. Thanks in advance

    As you have probably read, bind variables and histograms do not mix well.
    Histograms suggest that you have skew in your data such that different values should get different plans
    Bind variables exist so that SQL with different supplied values can be shared.
    Mix the two together and at parse time with bind variable peeking you get plans for specific values shared for all values.
    The solutions you have mentioned are the common approaches, together with a third - use literals not binds if you've got data skew (i.e. your histograms are justified) and don't want shared SQL.
    I would have thought that getting rid of some of these histograms may be the right approach if you're none of your application SQL is using literals to benefit from them.
    Can you confirm your version of Oracle.
    Further reading:
    http://jonathanlewis.wordpress.com/2009/05/06/philosophy-1/
    http://structureddata.org/2008/03/26/choosing-an-optimal-stats-gathering-strategy/
    http://richardfoote.wordpress.com/2008/01/04/dbms_stats-method_opt-default-behaviour-changed-in-10g-be-careful/

  • Open cursor for and bind variables

    Hello all,
    how can I assign values to a bind variable before opening a cursor?
    example code:
    DECLARE
       TYPE ref_cur_t IS REF CURSOR;
       l_ref_cur   ref_cur_t;
       l_query VARCHAR2 (100)
             := 'select * from table t1 where ndx= :var_index' ;
    BEGIN
       -- assign a value to :var_index
       OPEN l_ref_cur FOR l_query;
    END;Thanks!

    Something like this ->
    scott@ORCL>
    scott@ORCL>DECLARE
      2     l_ref_cur   sys_refcursor;
      3     l_query VARCHAR2 (100) := 'select * from emp where empno = :var_index';
      4     l_empno  number(4);
      5  BEGIN
      6     l_empno := &emno;
      7     -- assign a value to :var_index
      8     OPEN l_ref_cur FOR l_query using l_empno;
      9  END;
    10  /
    Enter value for emno: 7698
    old   6:    l_empno := &emno;
    new   6:    l_empno := 7698;
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:19.78
    scott@ORCL>Regards.
    Satyaki De.

  • Modify List of Values for Task Numbers in standard webADI template

    We are using webADI to load costs to Projects.
    When User use the webADI template to load costs to the Projects, he has to enter the following data in the template -
    1. Project Number
    2. Task Number
    3. Expenditure Item Date
    4. Expenditure Organization
    5. Amount
    ..... and so on....
    User enter the Project Number first. Based on the selection of the Project Number, the corresponding Task Numbers are seen in the Task Number column.
    Our requirement is, Users should not be able to select the Task Numbers in webADI whose Transaction Dates (Transaction Start Dates and Transaction End Dates) are beyond vis-a-vis the current system date.
    In other words, can we modify the List of Values for Task Numbers in standard webADI template
    Can this acheived.

    Any help or advice?
    Thanks.
    Regards

  • af:search shows required binding variables that is not want

    Hello,
    I have a WHERE clause similiar to this
    ... WHERE ([Binding Var 1] = 0 OR xzy_id IN (SELECT xzy_id FROM [Table] WHERE abc_id = [Binding Var2]))
    When writing this to the WHERE segment of the view all binding varibales need to be required.
    But when I use an <af:search> element in my jsff for searching through the table view all required binding variables are shown. I dont want that the element are shown because they are for internal use, only.
    Thanks for your hints.
    Greetings,
    Ayhan

    I haven't tried this - but what happens if you set the display hints for the bind variable to "hide?"
    John

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to save a new value for Set command variable

    I am using SET [variable = [String]] to update Set variable. It works fine. But when I restart MSDOS Prompt, I get old value for variable.
    How to save a new value for SET command variable?
    I am using Windows XP.

    And this has to do with java how?

  • Can we set a default value for the container variable in BPM?

    Can we set a default value for the container variable.?
    Suppose if i have a loop step and i have given a container variable i=5 as end condition.What value will it take during its first execution?Can we set the value for container before a recieve step?

    Hi
    Define Container Variable of Type integer and Category Simple Type .Use Condtion in Loop.
    In Container Operation Step Assign value and Use Expression to
    Increase or Decrease Valus according to your operation.
    look Pattern 4 in this blog to understand Container Operation
    /people/sharathchandra.girmaji/blog/2008/09/11/bpm-with-patterns-explained-part-1

  • Error with clob column: "No pl/sql translation for the blind type given for this bind variable"

    This is reports 11g
    I've got a clob column. Reports seems to recognize its type, but if I try to reference it in a format trigger, I get this error at compile time:
    "No pl/sql translation for the blind type given for this bind variable"

    Actually, Reports is in something better than Forms.
    Neither Forms nor Reports do not have "complete" SQL engine (both have only "complete" PL/SQL engine), but have their own SQL parser, which does not understand SQL commands after the database 8.0.
    But, in Reports Data Model - SQL Query Statement, we can write "modern" SQL statement (> database 8.0), because Reports sent it directly to the database, without using their own SQL parser.
    For example, in Reports Data Model - SQL Query Statement, we can write this (scalar subquery expressions, in bold):
    select empno,
           ename,
           deptno,
           (select dname from dept where deptno = emp.deptno) dname
      from emp
    order by empno;
    although scalar subquery expressions was introduced in the database 9.0.1, and in databases 8.0 and 8.1 we should write someting like this:
    select emp.empno,
           emp.ename,
           emp.deptno,
           dept.dname
      from emp,
           dept
    where dept.deptno = emp.deptno
    order by empno;
    Regards,
    Zlatko

  • CL20N Status changed: missing values for required chars for ROH & FERT

    Dear Expert,
    I am getting this message no. CL500 (Status changed: missing values for required chars) when I try to save variant class (Class type 300) assignment to material master (Raw Material) with Released 1 status in CL20N; but I do not get this message during assignment for FERT. I can save a FERT with Released1 status to a variant class without any system message. I am using configurable material in purchasing and this message is not valid in this case. Is there anywhere I can turn off this message for raw material just like FERT?
    Regards,
    HK

    Hello Han Keat,
    There are notes for this error message. Can you please check note 1537443 and 1431600 if it is in your system
    Thanks Amber

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • Running page in which VO requires bind variable values

    Hello,
    New to this.
    I’m running the HierarchyPG (Manager Self-Service) in JDeveloper 9i and it has several VOs expecting bind variable values. What is the best way to supply these values for running the page? Project compiles but receive error message: java.sql.SQLException: ORA-01008: not all variables bound
    Thanks for your time.
    Richard

    Thanks for quick response Gyan. I realized I had OA Developer Run Option and not OA Diagnostic. My page runs now.

  • How to pass a value to a bind variable in a query report in oracle apex

    Hi Guys,
    I have requirement to send weekly reports via email to some users. The users should receive their own records in the report. The user details is stored in a table. What I am planning to do is to create a report query in oracle apex to generate the report and then run a function/procedure via a scheduler to email the report to respective users. Now my query is ............. is it possible to pass a value (user name) to the report query to pull records of only that user? I know we can have bind variables in the report query but I have no idea how to pass a value for bind variables from a function/procedure.
    Can anyone help me on this issue or suggest a better approach?
    Thanks,
    San

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Unable to access Calender using Groups (as Manager) using PC

    I own a mac, but I'm doing the following on a friends PC. (That might be important to know or not). I went to my mac.com account and created a group. First time. When I was in my group, i clicked on the calendar area thinking it would open up and I c

  • Why it is error? (Function)

    Hello, I am trying to write a program to calculate a function like f(x) = asin(x+b)exp(cx) where a,b,c, and x is unfixed and users can input their values. After input all values of a,b,c and x, users click a button named "result", and result of that

  • Hide the focus indicator?

    Is there any way I can hide the focus indicator for everything in my document? Thank you for your help, Shane

  • How to fix the above mentioned, *"special Incoming Closed margins"*.

    Valuation runs (TPM1) fails with the error below: Unfixed bus. trans. with posting date 02/23/2012 before key date (long text) Message no. TPM_TLV1028 Diagnosis The position that is to be valued contains a position-relevant business transaction Close

  • Inserting FLV videos that allow student to start and stop anywhere

    Hello, I am inserting flv videos that students need to be able to start and stop anywhere, and when the video reaches the end, the student clicks on the NEXT button to go to next slide. As long as the student lets the video play without any interrupt