sql - Parametrized hexadecimal literal in DB2 C# IBM driver -
there db2 database.
there c#.net application, uses ibm.data.db2 driver connect database (ibmdb2).
there parametrized query (db2command object, initialized with): "select $coid_ref db.$ext $coid = @coid"
it's needed substitute @coid hexadecimal literal. example, should executed this: "select $coid_ref db.$ext $coid = x'aa23909f'"
but, when try add parameter via command.parameters.add("@coid", "aa23909f") driver tries add string, leads error. how can solve this?
you passing in regular string.
you need use hexadecimal literal value.
from find...
command.parameters.add("@coid", "\xaa\x23\x90\x9f")
what db2 platform working with? if ebcdic platform (ibm or z/os) might have problem string being translated...
but seems strange need. column defined 4 byte binary string? (is should char(4) bit data assuming you're not using unicode.)
Comments
Post a Comment