ORACLE Date Error

Asked

Viewed 92 times

0

Although I have many materials on the subject , nothing has helped me to solve.

I am trying to make a simple query in an oracle database and get an error, follow the error.

 OCIStmtExecute: ORA-01843: not a valid month

Follow my consultation.

   try {
        $linha = '';
        $sql = "SELECT * FROM SGT.VW_INFOGED";
        $p_sql = Conexao::conexaoOracle()->prepare($sql);
        $execute = $p_sql->execute();
        if ($execute) {
            $linha = $p_sql->fetchAll(PDO::FETCH_ASSOC);
            print_r($linha);
        } else {
            print_r($p_sql->errorInfo());
            return 'ERRO... CONTATE O SUPORTE';
        }
    } catch (Exception $ex) {
        echo "ERRRO" . $ex . "";
    }

Structure of the View

  Nome                  Nulo     Tipo         
--------------------- -------- ------------ 
ID_NOTA               NOT NULL VARCHAR2(27) 
NUMERO_NOTA                    VARCHAR2(10) 
REMETENTE_NOME                 VARCHAR2(50) 
REMETENTE_CNPJ                 VARCHAR2(14) 
DESTINATARIO_NOME              VARCHAR2(50) 
DESTINATARIO_CNPJ              VARCHAR2(14) 
SERIE_NOTA                     VARCHAR2(3)  
TERCEIRO_NOME                  VARCHAR2(50) 
MOTORISTA                      VARCHAR2(80) 
ROMANEIO                       VARCHAR2(10) 
VALOR_MERCADORIA               NUMBER(14,2) 
VALOR_FRETE                    NUMBER(14,2) 
ENDERECO_DESTINATARIO          VARCHAR2(50) 
REGIAO                         VARCHAR2(50) 
  • VW_INFOGED is table or view ?

  • VW_INFOGED is a view

  • The view must have some date conversion not handling the "Session" format, a TO_DATE without the format parameter (2nd parameter).

  • I didn’t understand much , I have to pass the TO_DATE where ?

  • Publish the view code

  • Man I’m very lay , when it comes to Oracle rsrs, sorry. Voce meant publish the view code?

  • The "SELECT" of the view.

  • This "SELECT * FROM SGT.VW_INFOGED";? or want to see the view structure ?

  • The sql of the view structure , the problem must be there.

  • got it. or update my question

  • I updated the question

  • The sql that generates the view also, create or replace view ....

  • Precisely , I do not have access to this sql , because I just make a connection in this database for an integration

  • You have to do with the area that supports this, I’m pretty sure the error is in the view.

  • Yes, I was able to solve, at the time of creating the view the guy was giving a Where with date , that’s why the error. Ai for him to put a TO_DATE and solved. Thanks

Show 10 more comments

1 answer

1


At the time of creating the view the guy was giving a Where with date , that’s why the error. I told him to put a TO_DATE and solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.