I have no idea if this case is connected with viewtopic.php?f=5&t=33825
If yes - just ignore it
Exception "Invalid argument to date encode" happens during execution in Direct mode when lines
Code: Select all
:DataOd := NULL;
:DataDo := NULL;
Code: Select all
declare
vIleRozlMag integer;
vIleRozlMagWtoku integer;
vIleZamkniete integer;
begin
select count(1)
into vIleRozlMag
from inw_rozl_mag rm;
-- :DataOd := NULL;
-- :DataDo := NULL;
if(vIleRozlMag = 0) then
:WYJ := -3;
end if;
if(vIleRozlMag > 0) then
select count(1)
into vIleRozlMagWtoku
from inw_rozl_mag rm
where rm.status = 'W TOKU';
if(vIleRozlMagWtoku > 0) then
select rm.data_do, rm.data_od
into :DataOd, :DataDo
from inw_rozl_mag rm
where rm.status = 'W TOKU'
and rownum <= 1;
:WYJ := 1;
else
select count(1)
into vIleZamkniete
from
(
select rm.data_do, rm.data_od, nvl(nk.pfk_numer, 0) pfk_numer, nvl(nk.suma_zaplat, 0) suma_zaplat, rank() over (order by rm.data_do desc) rn
from inw_rozl_mag rm
left join
zap_noty_ksiegowe nk
on (nk.numer = rm.znk_numer)
) a
where a.rn = 1
and
(
a.pfk_numer <> '0'
or
a.suma_zaplat <> 0
);
if(vIleZamkniete = 0) then
:WYJ := 2;
else
:WYJ := -2;
end if;
end if;
end if;
end;
P.C.