There are possibly two sources of errors:
- Loading raw data with SQL*Loader
- Querying the raw data
To check if the querying part works, use something like:
CREATE TABLE o_newstdata1 (field1 RAW(8));
INSERT INTO o_newstdata1(field1) VALUES ('12AB');
INSERT INTO o_newstdata1(field1) VALUES ('34EF');
You don't need to cast to a raw, you can use Oracle's hex format directly. Version 1 uses implicit conversion from RAW
TO VARCHAR2
, version 2 explicit conversion:
SELECT * FROM o_newstdata1 WHERE field1 = '12AB';
SELECT * FROM o_newstdata1 WHERE rawtohex(field1)='12AB';