LONG RAW types using PRO*C - Please help!

From: Bryan B Sorrows <bbsst+_at_pitt.edu>
Date: 21 Jun 93 03:11:51 GMT
Message-ID: <14783_at_blue.cis.pitt.edu>


Does anyone out there have experience using LONG RAW data fields with Pro*C?

I'm using V6.0.30 on SCO Unix...

I need to store ~ 2000 bytes of data ( < 2000 integers between 0 and 256 ), so I created a table with identifing info, and one LONG RAW column. Using Pro*C, I attempt to stuff the LONG RAW column with data by filling a variable defined as VARCHAR v_name[2000] with the data, one "char" per integer. When I attempt to UPDATE the LONG RAW column with the data, I get an error:
"can bind a LONG value only for insert into a LONG column".
I can get the data to load by converting it to HEX characters, and inserting those.
This seems kind of silly for RAW data. Is there any way to define a variable such that it can update a LONG RAW column without converting to HEX? My second problem is that I cannot get the data back out of the LONG RAW data field. I have not found any solution to this. (And, I don't know whether the insert is working as I think!). When I try to FETCH it into a VARCHAR field, I get an
"unimplimented or unreasonable conversion requested",
and when I use SQL*PLUS, I try using the RAWTOHEX function, but that will not work with LONG fields...

I am sure that I am approaching things wrong, but I'm not sure what I should try. VARCHAR seems like the only option for declaring the array in the C program, but I don't want Oracle to convert everything into printable characters!

Any help would be appreciated! If you could mail me sample code using the LONG RAW column type, it would save me from having to explore any more of my mis-guided approaches!

Thanks!

Bryan Sorrows
Voice: 412/371-7245
FAX: 412/371-7246
Email: bbsst_at_vms.cis.pitt.edu or bbsst_at_icarus.lis.pitt.edu Received on Mon Jun 21 1993 - 05:11:51 CEST

Original text of this message