help needed for Array / Type using in Form [message #86969] |
Wed, 24 November 2004 18:27 |
odeveloper
Messages: 34 Registered: September 2004
|
Member |
|
|
hi all gurus!
i created a form in 10g with multi record blocks. one block is base table and another is non-base table. i made this procedure to fill non-base table block from base-table block but its generating error while compiling it on -- enames my_varchar2 := my_varchar2(null) -- i have already created TYPE in db for my_varchar2 and it was successfully created. can you help me to do this as i want SORTED data from un-sorted (as see i used order by to sort).
thanks in advance.
PLEASE NOTE THAT THIS LINE IS WORKING IN SQL*PLUS ENVIRONMENT WHERE FORM IS GENERATING ERROR.
my code is:
PROCEDURE fill_values IS
enames my_varchar2 := my_varchar2(null);
total_records number;
ndx number:=1;
begin
last_record;
total_records := :system.cursor_record;
first_record;
for i in 1..total_records
Loop
enames.extend;
enames(ndx) := :emp.ename;
if to_number(:system.cursor_record) = total_records then
exit;
else
ndx:=ndx+1;
next_record;
end if;
End Loop;
go_block('TEMP');
ndx:=1;
for r in (select column_value val from table(enames) order by 1)
Loop
if r.enames is not null then
:TEMP.m_empname := r.enames;
ndx:=ndx+1;
end if;
if to_number(:system.cursor_record) = total_records then
exit;
else
next_record;
end if;
End Loop;
END;
|
|
|