Skip to content

error inserting None as Nulls using parameter in Teradata #57

@r-richmond

Description

@r-richmond

I receiving the following error message

File "/usr/local/lib/python3.6/site-packages/jaydebeapi/__init__.py", line 499, in execute
  self._set_stmt_parms(self._prep, parameters)
File "/usr/local/lib/python3.6/site-packages/jaydebeapi/__init__.py", line 490, in _set_stmt_parms
  prep_stmt.setObject(i + 1, parameters[i])

jpype._jexception.SQLExceptionPyRaisable: java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 16.10.00.03] [Error 1063] [SQLState HY000] null is not supported as a data value with this variant of the setObject method; use the setNull method or the setObject method with a targetSqlType parameter

when running the following code

sql = "insert into table (col1, col2) values (?, ?)"
row = (None,'name',)
cur.execute(sql, parameters=row)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions