Crystalboy1
Programmer
hi there,
I have written a function to check if a given date is a working day or not. the body of the function is given below.
function IsWorkingDate(datein varchar2) return boolean is
knt integer;
begin
insert into dmo_pwlb_reports_tt_isworking
select f_date
from tblholid_dat hol
where schedule = 'LONDON'
and (substr(datein, 5, 4) = '0101' or substr(datein, 5, 4) = '1225' or
substr(datein, 5, 4) = '1226' or
trim(to_char(to_date(datein, 'YYYYMMDD'), 'DAY')) = 'SUNDAY' or
trim(to_char(to_date(datein, 'YYYYMMDD'), 'DAY')) = 'SATURDAY');
select count(*) into knt from dmo_pwlb_reports_tt_isworking;
if knt = 0 then
return true;
else
return false;
end if;
end IsWorkingDate;
When i try to use the function
select isworkingdate(20081225) from dual
It gives me the following message.
ORA-06552: PL/SQL : Statment ignored
ORA-06553: PLS-382: Expresssion is of wrong type.
The strange thing is, if i test the function, its gives me the right results.
Please help!!!!
I have written a function to check if a given date is a working day or not. the body of the function is given below.
function IsWorkingDate(datein varchar2) return boolean is
knt integer;
begin
insert into dmo_pwlb_reports_tt_isworking
select f_date
from tblholid_dat hol
where schedule = 'LONDON'
and (substr(datein, 5, 4) = '0101' or substr(datein, 5, 4) = '1225' or
substr(datein, 5, 4) = '1226' or
trim(to_char(to_date(datein, 'YYYYMMDD'), 'DAY')) = 'SUNDAY' or
trim(to_char(to_date(datein, 'YYYYMMDD'), 'DAY')) = 'SATURDAY');
select count(*) into knt from dmo_pwlb_reports_tt_isworking;
if knt = 0 then
return true;
else
return false;
end if;
end IsWorkingDate;
When i try to use the function
select isworkingdate(20081225) from dual
It gives me the following message.
ORA-06552: PL/SQL : Statment ignored
ORA-06553: PLS-382: Expresssion is of wrong type.
The strange thing is, if i test the function, its gives me the right results.
Please help!!!!