What steps will reproduce the problem?
1. Create a table with a nullable geometry column
CREATE TABLE spots (
spot_id INTEGER NOT NULL IDENTITY(1,1),
spot_height NUMERIC(6, 2) NULL,
spot_location GEOMETRY NULL,
PRIMARY KEY (spot_id)
)
2. 'INSERT INTO spots (spot_height, spot_location) OUTPUT inserted.spot_id
VALUES (?, ?)' (420.39999999999998, None)
What is the expected output? What do you see instead?
The expected output is that the row with the NULL geometry is inserted into the
database. Instead I get the following SQL Error:
"[22018] [Microsoft][ODBC SQL Server Driver][SQL Server]Operand type clash:
image is incompatible with geometry (206) (SQLExecDirectW); [42000]
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be
prepared. (8180)"
What version of the product are you using? On what operating system?
pyodbc-2.1.7
Windows XP SP 3
SQL Server 2008
SqlAlchemy 0.6.1
Please provide any additional information below.
I am using pyodbc via SqlAlchemy. If I change the bind parameter from None to
an explicit 'NULL', then it works as expected.
Original issue reported on code.google.com by Mark.H...@mail.room3b.eu on 18 Jun 2010 at 9:16
Original issue reported on code.google.com by
Mark.H...@mail.room3b.eu
on 18 Jun 2010 at 9:16