how to show all empid in list item in oracle form during the runtime...
pl give me details with code.
table structure is create table dept( empid int,ename varchar2(20));
gv me full code of the under the form_instance_click.........
Software/Hardware used:
oracle form 10g...
ASKED:
June 20, 2010 6:30 PM
UPDATED:
June 22, 2010 7:26 PM
Here is how to do with a package:
create or replace Package Const as
TYPE rec_DDB IS Record (
dt varchar2(255), /* value to go into data part of ddb*/
ky varchar2(50) /* value to go into key part of ddb */
);
TYPE tab_DDB IS TABLE OF rec_DDB INDEX BY BINARY_INTEGER;
procedure Get_LOV (
In_Name in varchar2,
tDDB OUT ddb.tab_DDB
);
end const;
——————-
create or replace Package body Const as
procedure Get_LOV (
In_Name in varchar2,
tDDB OUT tab_DDB
) is
ptr pls_integer;
cursor c1 is
select …
from …
where …
order by …;
x1 c1%rowtype;
begin
tDDB.DELETE;
ptr := 0;
for x1 in c1 loop
ptr := ptr + 1;
tDDB(ptr).dt := x1.constant_meaning;
tDDB(ptr).ky := x1.constant_value;
end loop;
end Get_LOV;
end const;
———-
in Forms (in when-new-form-instance)
declare
xDDB ddb.tab_DDB;
BEGIN
const.get_lov(‘parameter-to-const’, xDDB);
Clear_List(‘b1.field_name’);
for ptr in nvl(xDDB.first,2)..nvl(xDDB.last,1) loop
add_list_element(‘b1.field_name’, ptr, xDDB(ptr).dt, xDDB(ptr).ky);
end loop;
xddb.delete;
end;