I'm trying to update a SQL table using Python's cx_Oracle library, but I'm getting error cx_Oracle.DatabaseError: ORA-00933: SQL command not properly ended, irrespective of the query end (with/without ;). Any ideas what may be happening?
UPDATE TABLE_NAME
SET ROW_NAME = 345434, ISSUE_DATE = 2020-02-03 12:14:28
WHERE ROW_ID = 327692
Note: the date is passed in as a datetime object. The code above is showing what is output from the stack trace.
CodePudding user response:
you have a comma at the end of issue date, also you will need to pass the date as a string
UPDATE TABLE_NAME
SET ROW_NAME = 345434,
ISSUE_DATE = '2020-02-03 12:14:28'
WHERE ROW_ID = 327692e
also you can do this:
UPDATE TABLE_NAME
SET ROW_NAME = 345434,
ISSUE_DATE = to_date('2020-02-03 12:14:28', 'yyyy-mm-dd hh:mi:ss am')
WHERE ROW_ID = 327692e
let me know if this helps :-)