Hi
I'm trying to create an Automation initiated on a PL/SQL Function Body returning Boolean, but I get following error: ORA-06550: line 17, column 14: PLS-00382: expression is of wrong type.
Code is basic, only returns True/False by a condition :
DECLARE
vnmCount INTEGER := 0;
vb_result boolean;
BEGIN
APEX_CUSTOM_AUTH.SET_USER('PAY_OWNER');
select 1
into vnmCount
from pay_t_periods
where COALESCE(automatic,'N') = 'S'
and trunc(SYSDATE) = trunc((end_date - COALESCE(aut_exec_date,0)))
and process_lov = 'NOMINA'
and STATUS_PERIOD_LOV = 'OPEN';
IF (vnmCount > 0) THEN
vb_result := true;
RETURN (vb_result);
ELSE
vb_result := FALSE;
RETURN (vb_result);
END IF;
END;
Apex version: 24.1.4 