10 pts.
 Oracle Forms 10g code
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

Answer Wiki:
This is <b>one way</b> to do it: <pre>Declare nIndex number := 0; Begin for i in (SELECT empid,ename FROM dept) loop nIndex := nIndex + 1; add_list_element('YourBlock.YourListItem',nIndex,i.ename ,i.empid); end loop; end;</pre> You could also do it using a record group.
Last Wiki Answer Submitted:  June 21, 2010  2:05 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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;

 70 pts.