I am writing small application in python which read records from Oracle and insert them into Vertica.
To read from Oracle I am using the cx_Oracle python package and to write into Vertica I am using the pyodbc package.
When I read a date column from Oracle I get it in the following format:
datetime.datetime(2011, 9, 13, 10, 47, 54, 795658)
Edit:
When I hit the following query in vertica :
INSERT INTO "TEST" (COL1) values(datetime.datetime(2011, 9, 13, 10, 47, 54, 795658))
I get the following error:
Error: ERROR: schema "datetime" does not exist
SQLState: 3F000
ErrorCode: 0
My question is how to convert this into a Vertica time stamp column.
You are trying to mix Python code and SQL; your Vertica server is trying to interpret the
datetime.datetimeinformation as a SQL schema, and it fails.Use parameters instead: