Thursday 28 May 2015

People want to know, how they dynamically populate a pop list? Means, At run time pop list will be populate. So there is no hard coded list element. Don't want to wait ?

You are at right place to learn it.

For this example code, i used SCOTT schema and DEPT table. You have to select privilege on the table.

It's a simplest example, First create a non-database block named DUMMY. create an item with type List Item named TXT_LIST. Data type CHAR, Length 30.
Now create a When-New-Form-Instance trigger at form/block level and write down the following code,

DECLARE
group_id RecordGroup;
group_name varchar2(10) :='abc';
status NUMBER;
BEGIN
group_id := find_group(group_name);
if not id_null(group_id) then
delete_group(group_id);
end if;

group_id := Create_Group_From_Query(group_name,'select DNAME,TO_CHAR(DEPTNO) from DEPT');
/* Select statement must have two column*/
status := Populate_Group(group_id);
Populate_List('DUMMY.TXT_LIST',group_id);
END;



Hope it works...
Copyright © ORACLE-FORU - SQL, PL/SQL and ORACLE D2K(FORMS AND REPORTS) collections | Powered by Blogger
Design by N.Design Studio | Blogger Theme by NewBloggerThemes.com