oracle raw datatype in where clause

use the functions of the UTL_RAW package to interact with raws, for example:

SQL> create table test (a raw(16));

Table created

SQL> insert into test values ('FF00FF00FF');

1 row inserted

SQL> select * from test where utl_raw.substr(a, 3, 1) = 'FF';

A
--------------------------------
FF00FF00FF

in Oracle : you can use HEXTORAW function

  • select * from TBLTest01 where (BINCOL=hextoraw('f0f0f3') )

it is in other databases in another way. for example in DB2 :

  • select * from TBLTest01 where BINCOL=BINARY(x'F0F0F3')

Tags:

Sql

Oracle