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 ?
– Motta
VW_INFOGED is a view
– Marlon Castro
The view must have some date conversion not handling the "Session" format, a TO_DATE without the format parameter (2nd parameter).
– Motta
I didn’t understand much , I have to pass the TO_DATE where ?
– Marlon Castro
Publish the view code
– Motta
Man I’m very lay , when it comes to Oracle rsrs, sorry. Voce meant publish the view code?
– Marlon Castro
The "SELECT" of the view.
– Motta
This "SELECT * FROM SGT.VW_INFOGED";? or want to see the view structure ?
– Marlon Castro
The sql of the view structure , the problem must be there.
– Motta
got it. or update my question
– Marlon Castro
I updated the question
– Marlon Castro
The sql that generates the view also, create or replace view ....
– Motta
Precisely , I do not have access to this sql , because I just make a connection in this database for an integration
– Marlon Castro
You have to do with the area that supports this, I’m pretty sure the error is in the view.
– Motta
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
– Marlon Castro