python - How to insert date value into vertica -


I am writing a small application in Python which reads the records from Oracle and insert them into Vertica.

To read from To Oracle I am using the cx_Oracle Python package and I'm using the pyodbc package to write in Vertica.

Edit:

When I press the following query in the workset:

  INSTERT "test" (COL1) Value (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 that it is called Vertica Time Stamp How to change the columns?

You are trying to mix Python code and SQL; Your Verteca server is trying to interpret datetime.datetime information as a SQL schema, and it fails.

Use instead:

  datetime import date time cursor. Execute ("INSERT INNTO" exam "(COL1) value (?) ', Date time (2011, 9, 13, 10, 47, 54, 795658))    

Comments