Hallo!
I have a table tstest(ts char(13) for bit data constraint a unique).
This column is filled in a trigger with generate_unique().
In a application (CLI), I have the values of this column as timestamp
representation: e.g.: select timestamp(ts) from tstest
1
--------------------------
2003-10-27-08.50.14.430717
My problem is, that i want do delete from this table with:
"delete from tstest where ts=?"
This means I want to use a parameter marker for the value.
How should I format the value, so that db2 understands it as char(13)
for bit data?
I have tried to use "delete from tstest where ts=TIMESTAMP(CAST(? AS
CHAR(26))", which works, but has a poor performance. So I think it would
have a better performance when I use the value without the cast.
Is there a way in SQLBindParameter, to tell db2 that it should interpret
the given value string as the hex representation of binary data?
e.g. with plain sql i would write:
"delete from tstest where ts=x'20031027085014430717000000'"
Is there a way to do it with SQLBindParameter?
thanks
andreas