Hello everyone,
I get this error when I generate the code bellow mentioned.
Error computing item default value for page item P1_JORNADA_ANUAL.
ORA-06550: line 42, column 17: PL/SQL: ORA-00923: FROM keyword not found where expected ORA-06550: line 8, column 1: PL/SQL: SQL Statement ignored
Code:
--------------------------------------------------------------------------------------------
DECLARE
L_EMPRESA B_LISTA_EMPLEADOS.EMPRESA%TYPE;
BEGIN
select case when ((select EMPRESA
from B_LISTA_EMPLEADOS
where USERNAME = v('APP_USER'))) = 'EMPRESA1'
then ((select to_char(JORNADA_ANUAL)
from B_JORNADAS_Y_RATIOS
where CATEGORIA = ((
select CATEGORIA
from B_LISTA_EMPLEADOS
where USERNAME = v('APP_USER')
))
and EMPRESA = ((
select EMPRESA
from B_LISTA_EMPLEADOS
where USERNAME = v('APP_USER')
))
and ANO = v('P1_ANO')
))
when ((select EMPRESA
from B_LISTA_EMPLEADOS
where USERNAME = :APP_USER)) = 'EMPRESA2'
then 'Jornada de EMPRESA2'
when ((select EMPRESA
from B_LISTA_EMPLEADOS
where USERNAME = :APP_USER)) = 'EMPRESA3'
then 'Jornada de EMPRESA3'
else 'Empresa desconocida'
end
into L_EMPRESA
as Jornada
from B_JORNADAS_Y_RATIOS
group by EMPRESA
RETURN L_EMPRESA;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
--------------------------------------------------------------------------------------------
Does someone know which or where is the mistake?
Thank you very much.
Regards