Subject | delete with null not executed |
---|---|
Author | hybriszero |
Post date | 2009-01-20T10:25:41Z |
Hi,
i have this query:
DELETE FROM "Prezzi" WHERE PR_IDORG=? AND PR_IDEVE=? AND PR_OP=? AND
PR_TT=? AND PR_CAUSALE=?
I set the parameters using setObject(index, value)
The query is executed as a preparedStatement.executeUpdate()
My problem is that the preparedStatement.executeUpdate()
returns 1 (success since i delete 1 record at a time) only when all
the parameters are not null (in this case it returns 0).
Looking at the driver code it seems that using setNull is pointless
since setObject can handle nulls by itself.
i'm using jdbc driver 2.1.6 with server version 2.0.4.
i will need to make this work also on server 1.5.x since the majority
of my userbase is sticked to that version.
All those delete queries are generated from metedata so it would be a
very hard pain to rewrite them to handle a null special case that
could happen in any column and table.
Any help?
i have this query:
DELETE FROM "Prezzi" WHERE PR_IDORG=? AND PR_IDEVE=? AND PR_OP=? AND
PR_TT=? AND PR_CAUSALE=?
I set the parameters using setObject(index, value)
The query is executed as a preparedStatement.executeUpdate()
My problem is that the preparedStatement.executeUpdate()
returns 1 (success since i delete 1 record at a time) only when all
the parameters are not null (in this case it returns 0).
Looking at the driver code it seems that using setNull is pointless
since setObject can handle nulls by itself.
i'm using jdbc driver 2.1.6 with server version 2.0.4.
i will need to make this work also on server 1.5.x since the majority
of my userbase is sticked to that version.
All those delete queries are generated from metedata so it would be a
very hard pain to rewrite them to handle a null special case that
could happen in any column and table.
Any help?