SQL DATE EXECUTION - ODBC

Asked

Viewed 36 times

0

I am doubtful in the date format that ODBC performs. I tried every way and nothing. This Query performs normal if I insert only the code, but when I want to enter dates it does not execute. I believe it is because of the format. Can someone help me?

$Query = "INSERT INTO TABLE(CODIGO, DATA_CRIADO) values (300, '2017-01-01')";
ODBC_exec($conn, $Query);
  • Try to catch the mistake with var_dump(odbc_errormsg($conn)); your connection is like autocommit?

  • Yes, the connection is autocommit

  • In which line does this syntax enter?

  • can be ODBC_exec($conn, $Query) or die(odbc_errormsg($conn));

  • 1

    It worked. ORA-01843: not a Valid Month

  • 2

    Found, it only accepts the written month. Example '10/may/2017"

  • use the formatted TO_DATE function to insert, making it always be converted before https://www.techonthenet.com/oracle/functions/to_date.php

Show 2 more comments
No answers

Browser other questions tagged

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