Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 976
  • Last Modified:

Insert Raw Data Into Oracle Table

Hello,

I have a table from a 3rd party Oracle database with an ID column whose data type is RAW(16).  I am trying to insert these ID values to a new table via a VB.NET console application that uses an ODBC connection.

Basically, i'm reading the data from the source, and then creating INSERT statements for the appropriate records to the new table.  However, for the ID column, VB.NET creates the following as the SQL: "INSERT INTO TABLE1(ID) VALUES(System.Byte[]);"

What do I need to do in order to successfully insert RAW data into the new table?

Thanks,
-Torrwin
0
Torrwin
Asked:
Torrwin
1 Solution
 
vvkCommented:
oracle should take char data in hexadecimal format with 2 characters representation per byte. or if you have utl_raw package installed you can use something like utl_raw.cast_to_raw('text to convert') to make raw values
0
 
sdstuberCommented:
if you have a hex string  you can use hextoraw


for example...

insert into table1(id) values(hextoraw('11223344556677889900aabbccddeeff'));


or use a different type, like  OracleDbType.Raw
0
 
TorrwinAuthor Commented:
Thanks, the RawToHex and HexToRaw functions were exactly what I needed.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now