Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error PL/SQL: ORA-00923: FROM keyword not found where expected

KAISSERSep 1 2015 — edited Sep 1 2015

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


This post has been answered by Jagadekara on Sep 1 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2015
Added on Sep 1 2015
7 comments
10,146 views