By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,501 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,501 IT Pros & Developers. It's quick & easy.

Equals-Operator on RAW Columns

P: n/a
Hi there,

I try to execute a DB-Update using
ADO.NET CommandBuilder (MSORA Data Provider) on Oracle 8.1.6
(unfortunately, ODP.NET seems to require Oracle 9i or above). One of
ADO.NET's
DataTable columns is of type Byte-Array, and refers to a RAW column
on the Oracle-DB. The CommandBuilder generates Update-Statements of
this kind:

Update table set col = :col_new_value where col = :col_old_value;

Ok, the parameters are actually called p0...pn. The problem is that
the Byte-Array will be expanded to an expression like
'0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f', so the statement will expand to:

Update table set col = 'ffffffffffffffffffffffffffffffff' where col =
'0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f';

The old RAW-value in the database is
'0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F'. But the update fails due to
missing capitalization - the equals-operator only seems to work on
capitalized hex values.

This one would work fine:

Update table set col = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'
where col = '0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F';

Due to the nature of ADO.NET CommandBuilder I cannot really influence
the way it generates its Update-statements. I cannot hardcode SQL
either (e.g. using HEXTORAW), as this legacy application is
continuously based on CommandBuilders.

Any ideas how to circumvent this behaviour? Is there a way to convince
Oracle to accept lowercase hex strings on equals comparisons as well?

Thanks a lot in advance!

Kind regards,
Arno Huetter
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.