Bug: htmldb_item.popupkey_from_query

See 24317:10 on htmldb.oracle.com
When my region query has a ORDER BY, it messes up the htmldb_item.popupkey_from_query. Clicking on the first popup LOV and selecting a value populates the 8th row!
Am I missing something or is this a bug?
Thanks

Finally got it
select
empno,
htmldb_item.hidden(3,empno)||htmldb_item.checkbox(2,rownum) box, null deptlov,
ename, job, sal, comm
from
(select * from emp order by ename)
deptlov is declaratively defined using Report Attributes as a popup LOV using the query
select dname,deptno from dept
This uses g_f01
My after submit process has
:P10_DEBUG := null;
for i in 1..htmldb_application.g_f02.count loop
:P10_DEBUG := :P10_DEBUG||','||htmldb_application.g_f01(htmldb_application.g_f02(i));
end loop;
:P10_DEBUG := :P10_DEBUG||chr(10);
for i in 1..htmldb_application.g_f02.count loop
:P10_DEBUG := :P10_DEBUG||','||htmldb_application.g_f03(htmldb_application.g_f02(i));
end loop;
Note that the outer select using the ROWNUM and the inner "select * from emp order by ename" is crucial.
If I just use
select
empno,
htmldb_item.hidden(3,empno)||htmldb_item.checkbox(2,rownum) box, null deptlov,
ename, job, sal, comm
from emp
order by ename
I get strange results. I check rows 3,5,7 and the after submit process processes some totally different rows!
My only remaining question is
Is it valid to use ROWNUM in this fashion? What would happen to rownum when I fetch the next set of rows as per my pagination scheme? Would it stay "in sync" with the hidden PK array in g_f03?
Thanks

Similar Messages

  • Htmldb_item.popupkey_from_query

    I have the following query for a region:
    select id Button,
    rownum B,
    htmldb_item.hidden(8, id) id,
    htmldb_item.popupkey_from_query(9,empid, 'select lastname, empid from employee order by deptid, lastname',20) Name,
    htmldb_item.text(10,note,20) note
    from personincharge
    where requestid = :P9_REQUESTID
    when I start the page and try to select an employee over the popup window (htmldb_item.popupkey_from_query) it works for the first row. When I try to select the second employee it doesn't update the appropriate field instead it writes the employee value in the "htmldb_item.text(10,note,20) note" field.
    What am I doing wrong here ?
    Thanks Tobias

    Tobias,
    When using popupkey LOVs, there are two items required to store the values. One item is the disabled text field that shows the display value. And the other item is a hidden field that is used to store the actual return value. You have assigned the ID number 9 to your popupkey LOV field in you query. This means that there will actually be two arrays, g_f09 and g_f10 used for this column. So your next field needs to get a number other then the ones already taken,if you change the text field to use ID number 11, things should work properly,
    Regards,
    Marc

  • Bug: htmldb_item.SELECT_LIST_FROM_QUERY p_null_text in

    called htmldb_item.SELECT_LIST_FROM_QUERY in my sql as
    htmldb_item.SELECT_LIST_FROM_QUERY
    ( 10, ss.CHOSEN_ID
    , ' select NAME as DISPLAY_VALUE
    , ID as RETURN_VALUE
    from OBJ_TPL_SELECT_OPTION
    where SELECT_ID = '||s.ID
    , 'onchange="doSubmit(''SAVE_AND_STAY'');"'
    , 'YES'
    , '0'
    and got
    report error: not all variables bound
    If removed the last argument, no error. just FYI
    Hope it will be fixed
    Kaja

    Seems like Sergio was right and the -- was interpreted as comment. I just changed it into '- Choose -' and it works. I just had a custom from php programming to put some -'s to display for empty choice.
    Thank you both,
    Kaja

  • Problem with popupkey_from_query

    Hi,
    I've created a customized tabular form in Application Express 3.1, using http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html.
    my query is like this.
    select x.empno, x.Employee_Name, x.Manager from
    (select
    htmldb_item.hidden(1,EMPNO) empno,
    htmldb_item.text(2,ENAME) Employee_Name,
    htmldb_item.popupkey_from_query(3,MGR,'select ename d, empno r from emp',10) Manager
    from EMP) x
    While running popupkey_from_query is behaviour is very odd, it's not returning the value in which row i was clicking. It returning the value in some other row.
    workspace : MICRO
    my userid : [email protected]
    password : test2008
    Can anyone point out where I was doing wrong?
    Thanks and Regards,
    Sudha.

    Hi Sudha Teki,
    In the query, in the 3rd line
    htmldb_item.popupkey_from_query(3,MGR,'select ename d, empno r from emp',10) ManagerMGR,
    This value should be one of the values in the P_LOV_QUERY parameter.
    Hope this little helps you.
    bye
    Srikavi

  • Htmldb_item.popup_from_query does not display what it must display

    Hello everybody,
    Is the any but with htmldb_item.popup_from_query, I am using it but it does not display the value but the key ?
    thank you.

    sounds like you want to use htmldb_item.popupkey_from_query as opposed to htmldb_item.popup_from_query....
    select htmldb_item.popupkey_from_query (1,deptno,'select dname, deptno from dept') dt from dept
    ...and there's more info on it in our online doc at...
    http://htmldb.oracle.com/i/doc/mvl_api002.htm#CHDEHBAC
    ...regards,
    raj

  • HTMLDB_ITEM   ... Help

    Hi I have the basic update form as shown below... I am trying to capture the data that is associated with the checked rows...
    Report with checkbox:
    select htmldb_item.checkbox(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    pl/sql submit process to capture rows..
    FOR I IN 1..HTMLDB_APPLICATION.G_F01.COUNT
    LOOP
    insert into test_table (pk) values ( HTMLDB_APPLICATION.G_F07(HTMLDB_APPLICATION.G_F01(i)) );
    END LOOP;
    Every time I run this process I get the following error...
    ORA-01403: no data found
    I am not sure why this is happening, I can insert HTMLDB_APPLICATION.G_F07(i) but it is not letting me reference "the seventh column" for each row that has been selected...
    any ideas?

    See Re: Problem with validation and tabular form
    Indices for F07 go from 1 to number of rows rendered on the report.
    f_07(f01(i)) evaluates to f_07(1234) if you select the checkbox corresponding to empno=1234.
    Clearly, this will generate a ORA-1403 since you don't have 1234 rows in your tabular form.

  • HTMLDB_ITEM.date_popup on single row report does not work

    Dear HTML DB Team,
    On a report wit a single( one ) row the "HTMLDB_ITEM.date_popup" does not fill the selected date to the cell. (Same for wwv_flow_item.date_popup)
    On the same report with 2 or more rows HTMLDB_ITEM.date_popup works fine.
    Any suggestions?
    Erik
    testcase:
    create region:
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    delete 13 rows from emp ( 1 row left ):
    delete from emp
    where ename <> 'KING';
    => date_pop does not work

    Using the htmldb_item API vs. built-in multi-row update functionality:
    I can't speak to the question about the date for the next HTML DB release. But I'd like to add a few comments to this discussion regarding the use of the htmldb_item API package. It is generally advisable to use the built-in multi-row update functionality instead of htmldb_item function calls when implementing tabular forms. While I do acknowledge that some display types such as date popups are not yet available, I would nevertheless recommend working with what's available on the report column attributes page (i.e. using a text field for the date columns) as opposed to using htmldb_item functions whenever possible. Please keep in mind though that they are mutually exclusive, so they can't be combined on the same report.
    The reasons for my recommendation are simple: first of all, if you use htmldb_item calls as part of your SQL statement, the HTML form elements are rendered for all rows in your result set. The built-in types on the other hand only render HTML form elements for those rows shown on your current page, thus you get better performance. Secondly, htmldb_item calls make your SQL statement quite complicated, not only has the engine to jump back and forth between executing your SQL and calling the PL/SQL functions, you also need to take extra care implementing your PL/SQL processes according to the item IDs you assigned in your htmldb_item function calls. When working with e.g. popup LOVs, this gets even more complicated because that type actually results into two html form elements for each column (one storing the hidden ID, one storing the display value). And lastly, by using the multi-row update functionality, you would get lost update detection automatically built. That means, that you can't accidentally overwrite another person's changes in the event that you should both be working on the same data. Implementing this kind of functionality with your htmldb_item based tabular forms would take a lot more effort than simply go with what's already provided.
    So please carefully weigh the benefits of additional display types that you'll get by using the htmldb_item API against all the functionality you'll get by using the built-in tabular form and multi-row update features.
    Regards,
    Marc

  • Popup lov in a report is not working if I have an order by caluse

    I created a form manually using the document from the url:
    http://otn.oracle.com/products/database/htmldb/howtos/tabular_form.html#MANUAL
    I used the following query from that document.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    This works fine.
    But if I add an order by clause to the query the popup key for mgr column doesn't work.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    order by ename
    Is this a bug ?
    Is there a work around ?
    Thanks
    Chandra.

    Chandra,
    Please refrain from asking the exact same question twice. It doesn't help the quality of this forum. If you have to, "bump" an existing unanswered question up (wait a day or two, please) in case it fell through the cracks.
    Now for the answer:
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename d, empno r from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from (select * from emp order by ename)
    Use an inline view like in the example above to do the sorting first. If you sort a result set that includes Popup LOVS, then the Javascript used to populate the text fields doesn't work anymore.
    Sergio

  • Popupkey_lov_from_query unusual behaviour..Urgent..please help

    Hi All,
    I have a SQL region -
    select c001,
    htmldb_item.select_list_from_query(2, c002, 'Select product_family_name d, product_family_id r from grp_product_families, 'onChange=doSubmit()', 'YES','-1000','Select') c002,
    htmldb_item.popupkey_from_query(3, c003, 'Select product_module_name d, product_module_id r from grp_product_modules where product_family_id = '''||c002||'''') c003,
    seq_id,
    collection_name,
    c002 displayonly
    from htmldb_collections
    where collection_name = 'PROD_IN_DB'
    Here, when I run the page and lets assume this query returns 4 rows. Then the first 2 rows Popup LOV will return the same set of records (Taking the product_family_id = c002 of the second row). Also, if I select something from the Popup LOV then the value instead of going into its own place holder goes to the Popup LOV placeholder of the previous record.
    Am i missing something.
    Please help.
    Thanks in advance,
    Monika

    Is this a bug. I am using HTMLDB 1.5
    Any workaround for this.
    I tried creating custom popup. Now, the custom popup gets populated correctly. But, here I dont know how to pass back the value to the calling page. The value now has to be passed to a report updateable column and that too in the correct row.
    For e.g, if the report of the calling page returns 4 rows (1,2,3,4) and I call the popup of the second row, then the popup should pass back the value selected into the second row column only.
    I should have something like this on the popup page
    opener.document.getElemenyById("Name of the report column with correct sequence id") := value;
    The name for this eg will be - HTMLDB_APPLICATION.G_F002(2)
    Any help will be appreciated.
    Thanks
    Monika

  • Custom tabular form for multi-row not saving data

    Ok, before anyone asks, yes, I did read the how-to:-)
    I have a custom tabular form, which I did cause I need to use popups and the popups that you can use in the wizard tabular form does not display the text but rather the value underneath it.
    It returns data rather nicely and when I go and update values I can tell it is changing the fields underneath. I put a process in that will display the values in text fields on the form (for one row only) and I see them changing from what is already there and with the proper values.
    However, when I do that the data that is displayed then gets reverted back to what it was previous to the update but reports that the process was successful.
    I have also tried to insert but that is basically doing the same thing. Can anyone guide me.
    SQL to generate the tablular form...
    SELECT x.sak_release_db
    , x.sak_object
    , x.sak_release
    , x.sak_participant
    , x.sak_csr
    FROM
    (SELECT htmldb_item.hidden(1,sak_release_db) sak_release_db
    , htmldb_item.popupkey_from_query(2, sak_object,
    'SELECT b.nam_schema||''.''||a.nam_technical as table_name , b.sak_object
    FROM system_object a
    , database_table b
    WHERE a.sak_object = b.sak_object') as sak_object
    , htmldb_item.hidden(4,sak_release) sak_release
    , htmldb_item.popupkey_from_query(5, sak_participant,
    'SELECT nam_first || '' '' || nam_last as name, sak_participant FROM co_participant') sak_participant
    , htmldb_item.popupkey_from_query(7, sak_csr,
    'SELECT external_id|| ''-''||id_split as co, sak_csr FROM co') sak_csr
    FROM release_db_xref
    UNION ALL
    SELECT htmldb_item.hidden(1,NULL) sak_release_db
    , htmldb_item.popupkey_from_query(2, NULL,
    'SELECT b.nam_schema||''.''||a.nam_technical as table_name , b.sak_object
    FROM system_object a
    , database_table b
    WHERE a.sak_object = b.sak_object') as sak_object
    , htmldb_item.hidden(4,NULL) sak_release
    , htmldb_item.popupkey_from_query(5, NULL,
    'SELECT nam_first || '' '' || nam_last as name, sak_participant FROM co_participant') sak_participant
    , htmldb_item.popupkey_from_query(7, NULL,
    'SELECT external_id|| ''-''||id_split as co, sak_csr FROM co') sak_csr
    FROM dual) x
    Process to verify that I have the correct global fields: (Type: PL/SQL anonymous block, Process Point: On Submit - After Computations and Validations)
    begin
    :P3_2 := replace(htmldb_application.g_f02(1),'%'||'null%',NULL);
    :P3_5 := replace(htmldb_application.g_f05(1),'%'||'null%',NULL);
    :P3_7 := replace(htmldb_application.g_f07(1),'%'||'null%',NULL);
    end;
    Process to do the insert/update. Note, I hardcoded the value in the where clause but I was originally using the global value for g_f01 (i also tried putting a commit in there for fun) (Type: PL/SQL anonymous block, Process Point: On Submit - After Computations and Validations):
    -- Update the RELEASE_DB_XREF table
    FOR i IN 1..htmldb_application.g_f01.count
    LOOP
    IF htmldb_application.g_f01(i) IS NOT NULL THEN
    UPDATE release_db_xref
    SET sak_object = replace(htmldb_application.g_f02(i),'%'||'null%',NULL)
    , sak_participant = replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
    , sak_csr = replace(htmldb_application.g_f07(i),'%'||'null%',NULL)
    WHERE sak_release_db = 22;
    ELSE
    IF htmldb_application.g_f02(i) IS NOT NULL THEN
    INSERT INTO release_db_xref
    (sak_object
    ,sak_release
    ,sak_participant
    ,sak_csr)
    VALUES
    (replace(htmldb_application.g_f02(i),'%'||'null%',NULL)
    ,htmldb_application.g_f04(i)
    ,replace(htmldb_application.g_f05(i),'%'||'null%',NULL)
    ,replace(htmldb_application.g_f07(i),'%'||'null%',NULL));
    END IF;
    END IF;
    END LOOP;

    Florian,
    Checkboxes are different from other HTML form items. When you have a text box for example, there's always a value send to the server when submitting. Even if that value is NULL. When you have a checkbox however, you only get the value if the checkbox is checked. It's not posted to the server when it is not checked. That's the general behavior of HTML forms and not specific to Oracle HTML DB.
    When working with tabular forms in HTML DB, you can access your form values using the htmldb_application.g_f0x arrays. Now if you have for example 10 rows in your form, then you'll get ten elements in your array for text boxes, select lists, etc. For checkboxes however you'll only get as many elements as you have rows checked. If I read your update and insert code correctly, you're trying to use the checkbox arrays the same way you use the arrays based on other item types. My recommendation would be to use Yes/No select lists instead of checkboxes or at least use select lists initially to get it working and then work on properly processing the checkboxes.
    Some general information about working with checkboxes in tabuar forms can be found here:
    http://www.oracle.com/technology/products/database/htmldb/howtos/checkbox.html#CHECKBOX_IN_REPORT
    Hope this helps,
    Marc

  • Access htmldb_application.g_f01 from Report Query ?

    I want to have a search functionality built into the report itself, so, was trying to create a sql report as:
    select htmldb_item.hidden(1,null) empno,
    htmldb_item.text(2,null) ename,
    htmldb_item.select_list_from_query(3,null,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,null,'select ename, empno from emp',10) mgr
    from dual
    union all
    select empno, ename, job, mgr
    from emp
    where empno = NVL(htmldb_application.g_f01(1), empno)
    and ename = NVL(htmldb_application.g_f02(1), ename)
    However, this gives an error saying "ORA-06553: PLS-221: 'G_F01' is not a procedure or is undefined".
    I changed the radio button to parse query at runtime only to ensure that the collection gets created first, but even then during runtime it gives the same error. I tried to create two reports (to try conditional display) the first report contain the union clause, and the second report just containing select * from emp where empno = htmldb_appl....
    even this is giving error.
    Is there anyway to achieve this functionality ?

    Ok, I created hidden columns for :p1_empno, p1:ename, p1:job etc and in a submit process assigned them to the htmldb_application.g_f01, ...etc, and changed the query to
    from emp where empno = nvl(:p1_empno, empno) and ....
    this is working,
    (a)Is there any better way to do it instead of creating these hidden columns.
    (b)how can we toggle this htmldb_item.hidden, ..., row (search row) display ? clicking on an icon in the column header should either display this row and clicking it again should hide this row.

  • Popup lov with order by clause

    I created a form manually using the document from the url:
    http://otn.oracle.com/products/database/htmldb/howtos/tabular_form.html#MANUAL
    I used the following query from that document.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    This works fine.
    But if I add an order by clause to the query the popup key for mgr column doesn't work.
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    order by ename
    Thanks
    Chandra.

    Duplicate post, see:
    popup lov in a report is not working if I have an order by caluse
    Sergio

  • Add member to a collection !

    Hello!
    I have a report region based on a content of a collection, the report item that display one of the members of the collection is a popkey lov item that I create using : htmldb_item.popupkey_from_lov
    my problem is : when I add a member to a collection, the report is not refreshing !
    I dont't now if the member is not added or another thing !
    But if I make the report item a simple text field, all is correct ?
    Any help ?

    jina--
    when talking about web pages, the term "element" generally refers to a single form element. for example...
    <input type="TEXT" name="myformelement" size="20" maxlength="20" />
    ...is a single form element. a report region like this...
    select ename, htmldb_item.checkbox(1,empno,null) c from emp
    ...would render one form element for each row in EMP. anyhow, now we've cleared that. please take a look at the example i posted for "chris" at...
    Re: radiogroup keep set: more problem
    ...i just took that example and replaced the queries for regions 2 and 3 with...
    select htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual union all
    select htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual union all
    select htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual union all
    select htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual
    ...and...
    select ename, htmldb_item.popupkey_from_query(1,c001,'select ename, empno from emp') c
    from htmldb_collections c , emp e
    where nvl(collection_name,'TRAPPED_VALS') = 'TRAPPED_VALS'
    and empno = c001
    union all
    select null ename, htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual union all
    select null ename, htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual union all
    select null ename, htmldb_item.popupkey_from_query(1,null,'select ename, empno from emp') c from dual
    ...respectively. with only that change to the example, the page seemed to work exactly as you've attempted to describe your requirement.
    --raj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with Pop up key list of values

    I have been looking at a problem with key popup list of values. I have some sql in a report region :
    select <columns>,"HTMLDB_ITEM.POPUPKEY_FROM_QUERY (47,resource_id,'select last_name,resource_id from rm_resource',30) "resource" ,
    <other columns> from
    <table name>
    now, when I select the value from the pop up it gets returned to the wrong row. Everything appears to be one row out of sync, so selecting an item for row 3 gets returned to row 2. Row 10 returns to row 9 etc.
    Looking at the code that is generated it appears to have messed up the sequences - I end up with two "genList0_f48_0" functions being generated.
    Any ideas why this happens?

    http://htmldb.oracle.com/pls/otn/f?p=37683:39
    On the page there are four records. selecting an Item from pop up in the last row gets placed in the row above.
    If you look at the javascript that gets run on the first two lines they both have the code "javascript:genList0_f21_0()" the third line has
    "javascript:genList0_f21_1()" when it should be "javascript:genList0_f21_2()"
    Hope this makes sense.

  • Htmldb_item_popupkey_from_query - returning a value.

    Hello,
    I have created a dynamic parameter page, based on some tables that I have.
    I was using select_list_from_query to generate a select list from a query stored in my ref_tbl. I switched to htmldb_item_popupkey_from_query because the query was generating too many rows. The popup box displays, but I can't get it to return any values to my dynamic form element. Below is part of the code.
    declare
    tablename varchar2(4000);
    -- DYNAMIC CURSOR DEFINITIONS
    TYPE Cur_Type IS REF CURSOR; -- define weak REF CURSOR type
    ref_cur Cur_Type; -- declare cursor variable.
    -- DECLARE RECORD
    rec ref_tbl%ROWTYPE; -- rec reoord is same type as ref_tbl row.
    begin
    OPEN ref_cur FOR -- open cursor variable
    'select table_name, column_name, col_static_lov, col_query_lov, seq_num, label, data_type from ref_tbl where table_name = :t order by seq_num' USING :TABLE_NAME;
    q := '<table class="t13BoxBody">';
    htp.p(q);
    -- table loop
    loop
    FETCH ref_cur into rec; -- fetch next row.
    EXIT WHEN ref_cur%NOTFOUND; -- exit loop when last row is fetched.
    if (rec.col_query_lov is not null) then
    q := q||'<tr><td>'||HTMLDB_ITEM.POPUPKEY_FROM_QUERY (3,'%',rec.col_query_lov,20,4000)||'</td></tr>';
    htp.p(q);
    end loop;
    CLOSE ref_cur; -- close cursor variable
    q :='</table>';
    htp.p(q);
    end;
    NOTE: col_query_lov = select distinct teacher_lastfirst display_value, teacher_lastfirst return_value from pd_teacher_tbl
    NOTE 2 : ref_tbl contains table name,column name pairs for each column in a table.
    Any assistance would be greatly appreciated. Thanks
    Sharon

    Tobias,
    When using popupkey LOVs, there are two items required to store the values. One item is the disabled text field that shows the display value. And the other item is a hidden field that is used to store the actual return value. You have assigned the ID number 9 to your popupkey LOV field in you query. This means that there will actually be two arrays, g_f09 and g_f10 used for this column. So your next field needs to get a number other then the ones already taken,if you change the text field to use ID number 11, things should work properly,
    Regards,
    Marc

Maybe you are looking for

  • How can I insert data in different table dynamically?

    I have one requirement ,In these  I have transaction table in which payLoad contain data like employee record,PO record,SO record  in XML format.Now I have transfer the data from transaction table to particular table(Emp,SO,PO) dynamical ? how can I

  • Palm Desktop 4.1.0 for Garmin iQue3600

    I have my Garmin iQue3600 synced with Palm Desktop version 4.1.0 which works fine with Vista but I can't use Help.  My iQue is dying and support has been totally discontinued, so I bought an iPod Touch to use as my PDA.  (I don't want a smartphone).

  • Fire wires

    Hi. I've got an iMac that is about a year old running 10.6.8.  I have just bought a new Macbook Pro and want to transfer some files across. I've followed the discussions about firewires and can see what to do but am not sure which fire wire cable I n

  • Galaxy Nexus 4.3 OTA Upgrade?

    It's Tuesday, 11 June 2013, and rumors continue about the much anticipated release of Google Jelly Bean 4.3 (or some variant of it). Though it didn't happen yesterday the 10th as some had expected--others now say July, an article by Robert Triggs jus

  • Re : sales order without assigning document type in OVAZ

    Hi     How to create sales order without assigning document type in OVAZ. Thanks Mani