ORA-00904 :: Invalid identifier

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
vvp0
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Tue, 23 Oct 2012 2:04 pm




I have a problem where I have an application that runs an appointment, but when running this query triggers an Error of ORA-00904 :: invalid identifier, but it does not say which identifier is invalid But when I squeeze it by the SQL tool runs without problem. I would like to know if you have any form, some select where I can see more in the background the mistakes fired by Oracle, to try to discover this identifier. Anybody know?

below the consultation

Select all

 
SELECT this_.DH_CONSULTA_INI                                                                                                              AS y0_, 
  ((DH_CONSULTA_INI - DBAMV.FNC_MVGF_MAIOR_DH_PROCESSO( this_.DH_CONSULTA_INI, this_.CD_TRIAGEM_ATENDIMENTO, ',30, 31,') )*24*60*60*1000) AS media, 
  this_.CD_TRIAGEM_ATENDIMENTO                                                                                                            AS y2_, 
  this_.CD_ATENDIMENTO                                                                                                                    AS y3_, 
  this_.DS_SENHA                                                                                                                          AS y4_, 
  this_.DH_CLASSIFICACAO_INI                                                                                                              AS y5_, 
  this_.DH_CLASSIFICACAO_FIM                                                                                                              AS y6_ 
FROM dbamv.GF_DADOS this_ 
WHERE this_.DS_SEQUENCIA_PROCESSO          ='1,2,3,4,5' 
AND this_.CD_MULTI_EMPRESA                 =1 
AND this_.DH_CONSULTA_INI                 IS NOT NULL 
AND TO_CHAR(DH_CONSULTA_INI,'hh24:mi:ss') >= '00:00:00' 
AND TO_CHAR(DH_CONSULTA_INI,'hh24:mi:ss') <= '23:59:59' 
AND this_.DH_CONSULTA_INI BETWEEN sysdate AND sysdate - 1 
AND DBAMV.FNC_MVGF_MAIOR_DH_PROCESSO( this_.DH_CONSULTA_INI, this_.CD_TRIAGEM_ATENDIMENTO, ',30, 31,') IS NOT NULL 
AND this_.CD_CLASSIFICACAO                                                                              =10 
AND this_.DH_CLASSIFICACAO_INI                                                                         IS NULL 
AND this_.CD_FILA_SENHA                                                                                IN (select cd_fila_senha from FILA_SENHA) 
ORDER BY this_.DH_CONSULTA_INI ASC 
 
User avatar
adrianoturbo
Moderador
Moderador
Posts: 393
Joined: Thu, 20 Mar 2008 4:09 pm
Location: Brasília
Adriano Alves
---Para cada problema dificil existe uma solução simples.----

Brother, make the following your function dbamv.fnc_mvgf_maior_dh_processo on the line below BEGIN and before SELECT Enter the statement: Run Immediate As shown in the example below:

Select all

 
BEGIN 
   [b]EXECUTE IMMEDIATE [/b]SELECT COUNT(HREM_IN_SEQUENCIA) INTO R FROM REMESSA 
      WHERE HCON_IN_SEQUENCIA = pHCON_IN_SEQUENCIA 
      AND   TRUNC(HREM_DT_ENVIO) = TRUNC(pHREM_DT_ENVIO) 
      AND   HREM_ST_TIPO <> 'RT'; 
    R := R + 1; 
 
         RETURN(R); 
END; 
 
made the select that will not give the error.
As we are working with dynamic instructions, it follows a nice concept of Oracle: http://docs.oracle.com/cd/B19306_01/app ... tement.htm I hope I have helped.
Good luck.
User avatar
adrianoturbo
Moderador
Moderador
Posts: 393
Joined: Thu, 20 Mar 2008 4:09 pm
Location: Brasília
Adriano Alves
---Para cada problema dificil existe uma solução simples.----

Select all

 
BEGIN 
   EXECUTE IMMEDIATE SELECT COUNT(HREM_IN_SEQUENCIA) INTO R FROM REMESSA 
      WHERE HCON_IN_SEQUENCIA = pHCON_IN_SEQUENCIA 
      AND   TRUNC(HREM_DT_ENVIO) = TRUNC(pHREM_DT_ENVIO) 
      AND   HREM_ST_TIPO <> 'RT'; 
    R := R + 1; 
 
         RETURN(R); 
END; 
Disregard the BS, I thought I could bold in the code.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests