Forms 6i (create data block manually) [message #83573] |
Thu, 30 October 2003 10:07 |
Paul
Messages: 164 Registered: April 1999
|
Senior Member |
|
|
I try follow (fill data block structure from procedure):
declare
S VARCHAR2(50);
I NUMBER;
CURSOR DF (dt_s1 DATE,dt_s2 DATE) IS
SELECT ipcrmain, dpcrsdt, dpcrfdt, ipcracc,
b.ccknname, c.cognsname,ccusname
FROM igg.pcr a, igg.ckn b, igg.ogn c,igg.cus d,igg.ncr
WHERE a.ipcrnum = b.icknnum
AND a.ipcrogn = c.iognnum
AND a.ipcrcus = d.icusnum
AND a.dpcrsdt >= dt_s1
AND a.dpcrsdt <= dt_s2
union
SELECT ipcrmain, dpcrsdt, dpcrfdt, ipcracc,
b.ccknname, 'Clients',ccusname
FROM igg.pcr a, igg.ckn b, igg.cus d
WHERE a.ipcrnum = b.icknnum
AND a.ipcrogn is null
AND a.ipcrcus = d.icusnum
AND a.dpcrsdt >= dt_s1
AND a.dpcrsdt <= dt_s2;
MC DF%ROWTYPE;
begin
OPEN DF(:d1,:d2);
I:=1;
loop
fetch df into :main_t(i).ipcrmain, :main_t(i).ipcrsdt,:main_t(i).ipcrfdt,
:main_t(i).ipcracc,:main_t(i).ccknname,:main_t(i).cognsname,:main_t(i).ccusname;
exit when df%notfound;
i:=i+1;
end loop;
*************************
main_t - data_block.
receive error: bad bind variable ':main_t'
Why?
i want show result of query on the forms....
may be exist another ways?
thanks..
|
|
|
Re: Forms 6i (create data block manually) [message #83586 is a reply to message #83573] |
Sun, 02 November 2003 03:25 |
sameer_am2002
Messages: 129 Registered: September 2002
|
Senior Member |
|
|
Usage is like this .
go_block('BlockName') ;
loop
fetch df into :main_t.ipcrmain, :main_t.ipcrsdt,:main_t.ipcrfdt,
:main_t.ipcracc,:main_t.ccknname,:main_t.cognsname,:main_t.ccusname;
exit when df%notfound;
if :system.last_record = 'TRUE' then
exit ;
else
next_record ;
end if ;
end loop;
|
|
|