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 DFd1,: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..
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 DFd1,: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..