Using Dynamic LOV in Forms

Hi Everybody,
I am making forms based on procedures in 9iAS Portal. I am using two parameters for the form. One is Item Code for which I am having a simple LOV with sql statement. Other LOV has a dynamic Sql statement which accepts the Item_code as parameter and displays records containing the item_code. When I run the Lov seperately through navigaror it runs properly but when I used the lov through form and passed the item_code to it, on runtime it says that the lov is based on dynamic sql and unable to show results.
Can anybody please help me out of this problem.
Thanks in advance
Warm Regards
Vivek Bajaj

When I tried to compile the following code in Forms, the compiler error I got was Encountered the symbol "STMT_STR" when expecting one of the following: select. However, when I run it in SQLPlus, it creates the function without any errors.
FUNCTION my_func
return number
is
TYPE DiaryCurTyp IS REF CURSOR;
cur DiaryCurTyp;
stmt_str VARCHAR2(200);
dmonth NUMBER;
dday NUMBER;
BEGIN
stmt_str := 'SELECT dmonth, dday FROM p2_diary
WHERE dmonth = :1';
OPEN cur FOR stmt_str USING '12';
LOOP
FETCH cur INTO dmonth, dday;
EXIT WHEN cur%NOTFOUND;
-- <process data>
END LOOP;
CLOSE cur;
END;

Similar Messages

  • Default value of combobox using dynamic LOV in Oracle Portal form

    We are trying to specify the deafult value of a combobox on a form that derives it options from a dynamic LOV. The option value is a number and the display is text.
    E.g.
    <Option value="1">Books
    <Option value="2">CDs
    We have tried various ways of setting the default option to be selected on the Combobox. First, we tried using a sql query to return a number from a table (sql query returns number -> in the default value type field). Next, we tried to use a constant number (default value: 2, default value type: constant). In neither case, did the Oracle Portal form pre-select our default choice in the drop-down list.
    Any suggestions? I browsed the other forum articles on this topic and noticed several folks believed it was a bug in Portal. We are using Portal version 3.0.9 (latest App Server for the Ebusiness Suite). Thanks in advance.

    You can manually add the select list (or for that matter anything else) to a wizard created form. If the select list is for an existing item, simply change the "Display As" setting from Text to a Select List based on the LOV you create. Any changes made will then be applied by the update process.
    cheers,
    Ron

  • Creating dynamic LOV in form builder 6i

    Hi All,
    I am new to form builder.
    I want to create dynamic lov, means
    Project type
    Client
    Work_type(thsi is also lov) ->> 1) Billable
    Reason (this is also lov) ->> 1) Billable
    Work_type(thsi is also lov) ->> 2) Non-Billable
    Reason (this is also lov) ->> 1) Fresher
    2) Project Manager
    As shown above, Suppose the project type is client then I will select either "Billable" or "Non-Billable" value.
    If I am selecting Work_type LOV as "Billable" then it should display "Billable" value in reason LOV
    or if I am selecting Non-Billable value from Work_type LOV then reason LOV will display the list of value as Fresher and Project Manager.
    Please help me, its very urgent.
    Thanks in advance.
    Regards,
    Bluetooth

    Bluetooth,
    This can be accomplished by creating two seperate record groups; one for Billable and one for Non-Billable. Then - in the WORK_TYPE When-Validate-Item (WVI)trigger - when the value is "Billable" you assign the Billable Record Group to your LOV or if the value is Non-Billable, then you assign the Non-Billable record group to your LOV. Your Record Group queries must return the same number of columns and the column names must match. If your record groups need to have a different number of columns and column names, then I would just use two seperate LOV's and assign them to the item accordingly. For example:
    /* Sample WVI trigger */
    DECLARE
      lov_id    LOV;
      item_id   ITEM;
    BEGIN
      lov_id := Find_LOV('YOUR_LOV_NAME');
      /* Option 1: Change Record Group of LOV */
      IF ( :YOUR_BLOCK.WORK_TYPE = 'BILLABLE' ) THEN
        IF ( Get_LOV_Property(lov_id, GROUP_NAME) != 'BILLABLE_RG' ) THEN
          Set_LOV_Property(lov_id, GROUP_NAME, 'BILLABLE_RG');
        END IF;
      ELSIF ( :YOUR_BLOCK.WORK_TYPE = 'NONBILLABLE' ) THEN
        IF ( Get_LOV_Property(lov_id, GROUP_NAME) != 'NONBILLABLE_RG' ) THEN
          Set_LOV_Property(lov_id, GROUP_NAME, 'NONBILLABLE_RG');
        END IF;
      END IF;
      item_id := Find_Item('YOUR_BLOCK.REASON');
      /* Option 2: Seperate LOV's */
      IF ( :YOUR_BLOCK.WORK_TYPE = 'BILLABLE' ) THEN
        IF ( Get_Item_Property(item_id, LOV_NAME) != 'BILLABLE_LOV' ) THEN
          Set_Item_Property(item_id, LOV_NAME, 'BILLABLE_LOV');
        END IF;
      ELSIF ( :YOUR_BLOCK.WORK_TYPE = 'NONBILLABLE' ) THEN
        IF ( Get_Item_Property(item_id, LOV_NAME) != 'NONBILLABLE_LOV' ) THEN
          Set_Item_Property(item_id, LOV_NAME, 'NONBILLABLE_LOV');
        END IF;
      END IF;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Dynamic LOV on form in update mode

    I have a link to a portal form that specifies the primary key as below:
    Portal30.wwv_user_utilities.get_url(
    'application.form_link',
    'primary_id',to_char(id),
    '_primary_id_cond','=');
    This works well. I can access the form in update mode for the specified row. However, on the form I have 2 combo boxes: one is for make of vehicle and the other for model. The make combo box uses an lov derived from a simple table query. The model combo box is a dynamic lov using a query based upon the value of the model. When entering the form in update mode, it fails to set the make bind variable to anything, so the model is left blank with no options. How can I set the value of the make bind variable on the link so I can get the dynamic lov for the model to be populated correctly?
    (I have already tried to add the model to the url link, to no avail).
    null

    Hi noor,
    When I click the link button I am opening the userdefined form and filling the corresponding document number details manually.
    Do you mean, you're filling the form, field by field???
    If so you're doing it wrong. That way the form has no connection to the correct Database record and cannot update it.
    The correct way is as follows:
    Put a DocEntry field in your form and bind it to the DocEntry database field.
    Set this field to NOT Visible by default.
    When a user clicks the LinkButton, you change the form mode to FindMode, make the DocEntry field visible use the oForm.Items.Item("DocEntry").Specific.Value = "" method to set the correct value to the field (use the DocEntry number NOT the DocNum) and use the oForm.Items.Item("1").Click() to open the correct record.
    Then the user can change the value it needs without errors.
    Best Regards,
    Vítor Vieira

  • Using Dynamic SQL in Forms

    Does anyone know anything about Dynamic SQL not being available in Forms v. 6.0.8.11.3? I trying to use Dynamic SQL for the first time and am having some difficulty. When I try to put my SQL in a function and run it straight into the database through SQLPlus, it works fine, but when trying to compile the code in Forms Builder (in a library), I get compiler errors. Any help would be appreciated...
    Thanks!
    Vanessa

    When I tried to compile the following code in Forms, the compiler error I got was Encountered the symbol "STMT_STR" when expecting one of the following: select. However, when I run it in SQLPlus, it creates the function without any errors.
    FUNCTION my_func
    return number
    is
    TYPE DiaryCurTyp IS REF CURSOR;
    cur DiaryCurTyp;
    stmt_str VARCHAR2(200);
    dmonth NUMBER;
    dday NUMBER;
    BEGIN
    stmt_str := 'SELECT dmonth, dday FROM p2_diary
    WHERE dmonth = :1';
    OPEN cur FOR stmt_str USING '12';
    LOOP
    FETCH cur INTO dmonth, dday;
    EXIT WHEN cur%NOTFOUND;
    -- <process data>
    END LOOP;
    CLOSE cur;
    END;

  • Dynamic SQL in Forms

    I' d like to use dynamic SQL in Form, but i'm attacking a access database(ODBC OCA).
    Is there any way to do that?
    Thanks.
    null

    SEE ALL EXAMPLES
    =============
    Example 1
    ** Built-in: FORMS_DDL
    ** Example: The expression can be a string literal.
    BEGIN
    Forms_DDL('create table temp(n NUMBER)');
    IF NOT Form_Success THEN
    Message ('Table Creation Failed');
    ELSE
    Message ('Table Created');
    END IF;
    END;
    Example 2
    ** Built-in: FORMS_DDL
    ** Example: The string can be an expression or variable.
    ** Create a table with n Number columns.
    ** TEMP(COL1, COL2, ..., COLn).
    PROCEDURE Create_N_Column_Number_Table (n NUMBER) IS
    my_stmt VARCHAR2(2000);
    BEGIN
    my_stmt := 'create table tmp(COL1 NUMBER';
    FOR I in 2..N LOOP
    my_stmt := my_stmt&#0124; &#0124;',COL'&#0124; &#0124;TO_CHAR(i)&#0124; &#0124;' NUMBER';
    END LOOP;
    my_stmt := my_stmt&#0124; &#0124;')';
    ** Now, create the table...
    Forms_DDL(my_stmt);
    IF NOT Form_Success THEN
    Message ('Table Creation Failed');
    ELSE
    Message ('Table Created');
    END IF;
    END;
    Example 3:
    ** Built-in: FORMS_DDL
    ** Example: The statement parameter can be a block
    ** of dynamically created PL/SQL code.
    DECLARE
    procname VARCHAR2(30);
    BEGIN
    IF :global.flag = 'TRUE' THEN
    procname := 'Assign_New_Employer';
    ELSE
    procname := 'Update_New_Employer';
    END IF;
    Forms_DDL('Begin '&#0124; &#0124; procname &#0124; &#0124;'; End;');
    IF NOT Form_Success THEN
    Message ('Employee Maintenance Failed');
    ELSE
    Message ('Employee Maintenance Successful');
    END IF;
    END;
    Example 4:
    ** Built-in: FORMS_DDL
    ** Example: Issue the SQL statement passed in as an argument,
    ** and return a number representing the outcome of
    ** executing the SQL statement.
    ** A result of zero represents success.
    FUNCTION Do_Sql (stmt VARCHAR2, check_for_locks BOOLEAN := TRUE)
    RETURN NUMBER
    IS
    SQL_SUCCESS CONSTANT NUMBER := 0;
    BEGIN
    IF stmt IS NULL THEN
    Message ('DO_SQL: Passed a null statement.');
    RETURN SQL_SUCCESS;
    END IF;
    IF Check_For_Locks AND :System.Form_Status = 'CHANGED' THEN
    Message ('DO_SQL: Form has outstanding locks pending.');
    RETURN SQL_SUCCESS;
    END IF;
    Forms_DDL(stmt);
    IF Form_Success THEN
    RETURN SQL_SUCCESS;
    ELSE
    RETURN Dbms_Error_Code;
    END IF;
    END;

  • Issue about dynamic lov

    Hello exper,
           I want to use dynamic lov for parameter.  when editing this parameter, I select "dynamic" for lov, "account_id" for value. but no list of value for this parameter in the parameter dialogue. My data source is oracle stored procedure.
    Many Thanks,

    when you create the parameter you are selecting DYNAMIC, then you select the field to pull from
    then you place the parameters in the record selection correct?
    make sure you lov doesnt change when data is entered, they do not update themselves and require daily maintenance.
    when you run your report does the value you are looking for show up, it will only display if it is in the dataset.

  • Dynamic LOV only Mondays.

    Does anybody know of a way to use dynamic LOV's to build a select list of dates that only lists mondays?

    select the_num, to_char(the_date,'Day, Mon DD,YYYY') the_date,the_day
      from (/* generate 365 rows */
               select level the_num,
                      sysdate + level the_date,
                      to_number(to_char(sysdate + level,'D')) the_day
                 from dual
              connect by level < 366) r
    where the_day = 2I beleive there is an NLS setting that determines what day your week starts on, which could throw this off, but you could easily adject for that.
    Thanks,
    Tyler

  • Dynamic LOV, AJAX, &-Character included

    Hello *,
    I've used the code that was posted I think by Vikas to use dynamic LOVs. (get_ajax_select_xml an so on) Everything worked fine until I've loaded up several rows from an excel-sheet. Some "second LOVs" were empty, depending of the choice in the first one. Wondering about that I've tried to debug and to find out the problem:
    In my two LOVs I have in the first one a supplier category and in the second one the company name. And here is the problem:
    If the company name of the supplier includes a "&"-Character the second LOV is empty (e.g. "Brown & Smith" ).
    Has anybody a solution or a workaround for that problem ?
    Best regards
    Oliver

    Thanks for you quick reply. I used "escape_sc" in the "application process-select". Now it works fine:
    SELECT id, HTF.escape_sc(name) AS name,FROM supplier

  • Dynamic lovs in parameter forms ... Is this possible?

    Hi
    I am using report developer 10g on windows xp.
    I need a cascading prompt style dynamic LOVs in my report parameter form.
    The first LOV displays a set of values (say for eg. dept list). The second LOV will display another list, based on the value chosen by the user in the first LOV (Eg. List of employee names in that dept).
    My first LOV select statement may look like below for the user parameter say P_DEPT
    select deptno from dept;
    My sencod LOV select stmnt may look like below for the user parameter P_EMP
    select ename from emp where deptno = :P_DEPT
    Each time I try to set the second LOV, report developer complains "Bind variables not allowed in select statement"
    Same error msg comes if I reference the first user parameter(P_DEPT) as a lexical parmaeter.
    How do I acheive the above in report parameter form? Any help is appreciated greatly...
    Thanks
    Suma
    Message was edited by: suma
    user519129

    Hi Brad,
    Thanks for the reply. I had almost given up hope on receiving replies to this message.
    I do agree that it is simpler (and a lot striaght forward) to just use forms to develop dynamic LOVs of cascading prompt style, that is required in my app. But in our shop, we have integrated forms and reports in such a way, that all the report parameters are handled by report developer's own parameter form, rather than coding a separate logic on the forms side to handle the report parameters(as this has to be done on the forms side for every report that we generate, We thought it would be better to use the reports developer to handle the parameter input and then pass the .rdf to forms app). Currently in all our app, the parameter form generated by the report developer is rendered as HTML form on the browser (when the concerned rdf file is called within the forms app) and by submitting this we get the report output)
    Hence I am very keen to get this done somehow on the report developer side.
    I do hope I get some input on this. Also, its a little surprising that such a simple feature is not readily avalibale in the report parameter form. I hope oracle report developer team is reading this message...:)
    Thanks
    Suma

  • Dynamic LOV in a Tabular Form

    Can somebody please tell me if there is a easy way to code a
    dynamic LOV in a Tabular Form?
    I need the ability to access a column value in the table row, to use in the WHERE clause of LOV query for another column in the row? Seems
    like that should be easy , but not finding an answer.
    Thanks for any help.
    Carol

    Hi Carol,
    You can add the select list's definition directly into your SQL statement using APEX_ITEM.SELECT_LIST_FROM_QUERY - see: [http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDIDGDA]
    If you first run your page with your existing select list on it, then do a View Source and look for the select list, you will see a "name" attribute of something like "f01" or "f02" etc. Make a note of the number part of this.
    Then update your SQL statement to include the above and using the number you noted as the Index value (say, 4):
    SELECT EMPNO,
    ENAME,
    DEPTNO,
    APEX_ITEM.SELECT_LIST_FROM_QUERY(4,MGR,'SELECT ENAME d, EMPNO r FROM EMP WHERE DEPTNO = ' || DEPTNO || ' AND EMPNO &lt;&gt; ' || EMPNO) MGR
    FROM EMPThat would give you a select list of employees in the same department as the current employee (excluding that employee themself)
    Andy

  • Select item on a Tabular form with a different dynamic LOV on each row

    I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
    So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
    -- Justin

    I'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
    Here's the query:
    select apex_item.display_and_save(1,dept) dept,
    apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
    from dept_emp
    I removed the code that was there already (ApplyMRU) and just put in this code:
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    UPDATE dept_emp
    SET
    name=HTMLDB_APPLICATION.G_F02(i)
    WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
    END LOOP;
    END;
    The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
    http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
    The thing I could not get to work was a dynamic message
    #MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
    Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
    You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
    Thanks again everybody!

  • Is there a problem using popup LOVs in a portal form with a bind variable?

    I have a portal form with 2 LOVs. The second LOV is a dependent LOV whose bind variable can be NULL. I have read Note 263923.1, "How To Create Dependent Lovs In Forms", and my form works as long as I use combo boxes to display the LOVs. I need to use popups so the user can search the LOVs as they are quite lengthy. Plus I want to be able to pick a value from my second LOV without selecting a value from the first LOV -- hence, my bind variable can be null and that is where my problem lies. As long as I select a value from the first LOV, the second LOV popup will work. If I click on the icon to display the second LOV without pre-selected a value from the first LOV, I get the following error:
    POPUP LOV ERROR:
    LOV: "9A17692880B6B8509F514F5B9CA9EC808DD403218B3CF19A33C04CD1FAB0ADE17ADC33E6B67998A933357CE5264D204E"
    Parse Message: Parse as pre-set global: "TORE".
    Find Message: LOV is of type DYNAMIC (LOV based on SQL query).
    Query: "SELECT ...."
    wwv_bind.prepare_bind: ORA-01403: no data found
    My form is based on a table with a custom layout. The sql for the second LOV is similar to: SELECT ENAME, EMPNO FROM SCOTT.EMP WHERE (DEPTNO = :DEPT AND :DEPT IS NOT NULL) OR :DEPT IS NULL.
    Thanks in advance for any help,
    Carol

    Don't use EPS any more! It does not support transparency nor color management.
    If you save vector files from Illustrator, use AI with PDF compatiblity.
    If you save image files from Photoshop, use PSD.
    If you save image files combined with vector forms and/or text from Photoshop, use PDP which is a Photoshop PDF.
    For vectors from Illustrator use CMYK files.
    For images use RGB, conversion to CMYK should never done before PDF export, better, if the printer allows it, is to export a PDF with live transparency as it is PDF/X-4
    If the printer requires a PDF with CMYK only export a PDF/X-1a.

  • Dynamic LOV FOR TABULAR FORM 6i

    Hi,
    I have tabular form of two Items(ID,DESC) and I want to Populate LOV for item(ID) every record
    and record_Group & SQL statments are stored in DB.
    ACTION: when query in POST-QUERY Trigger get for every record in tabular form -- the stored SQL-Statment from table then put it into dynamic record_group and populate the dynamic LOV.
    Please advice,
    Thanks in Advance.

    OK daniel
    This form used for get reports
    then header get the name of Report (Table-A) (report_ID),(report_desc).
    then details for get the Parameters will send to report builder (Table-B) (detail_id),(report_id),(sql_stm).
    so parameters may be need for example stock code so this record need to query from stocks table to get stock code and stock name.
    next record for item Code so need to query from Items table to get the Item code and Item name
    another report for employees so the user enter report code then when query and get in details block employee code and employee name.
    so the lov will check if this record have query sql-statment or not if have execute it in the record_group then in lov
    then go to the next record if sql_stm is null then no lov in this record and so on.
    thanks..

  • How do I use dynamic JSP vars in a form tag with implicit sessions?

    I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
    Here's my code sample:
    <FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
    Output is:
    <FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
    Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??

    Thanks for helping me Anurag.
    The problem I tried to solve was that I want the result from my service methods
    in XML format. I thought a callback/polling was the best alternative, am I right?
    Since the callback option doesn´t work I will try to poll the service.
    Are there any other options for solving my problem??
    Thanks again!!
    /A
    "Anurag Pareek" <[email protected]> wrote:
    >
    Andrej,
    I guess you are trying to invoke a Webservice which defines a callback
    method
    from a JSP, and want the JSP to handle the callback made by the webservice.
    For a client to be able to handle a callback made by a Webservice, it
    has to be
    a web service in itself.
    Even some web service tools do not support 'Solicit responses' and hence
    they
    would not generate handlers for the callback methods by default. You
    can download
    a callback WSDL in such cases and implement it on the client side. The
    server
    side web service will then callback to that webservice.
    The other option to callbacks is to use polling methods. This can be
    done from
    any client such as Java client/ JSP client or a .NET client.
    Hope this helps. Let me know if you have any further questions.
    Regards,
    Anurag
    "Andrej" <[email protected]> wrote:
    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

Maybe you are looking for

  • Oracle standard example doesn't work

    Hi All, I am surprsied to see that following standard example from Oracle doesn't work as expected. http://www.oracle.com/technology/products/integration/esb/files/stringtoxml.zip Did any one face same error with it? Regards, Vigni

  • Changes to VO not available in Apps

    Hi, I have made some changes to my custom VO, copied the xml and class files to the correct directory on the server, however my changes are not available/visible in apps. I already cleared the mid-tier cache and bounced the Apache webserver, but with

  • Cloudmark Engine Update Failure in FPE

    Hi,   I am receiving "An error occurred while processing the universal manifest" for the Cloudmark engine updates in Forefront Protection for Exchange 2010. The error event is attached below. I have manually downloaded  the engine updates but receive

  • Photo editor Crashing!

    Hi everybody, photo editor says "unfortunately application stop." When I location setting is turn off application works well. How can I fixing this issue?

  • On add button blank other text boxces

    I am trying to add new record so i want to write code for add button as all the related text boxes will get blank for new record insertion so can you help me out --sanket.