Solved

Insert Raw Data Into Oracle Table

Posted on 2011-09-12
3
898 Views
Last Modified: 2012-05-12
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
Comment
Question by:Torrwin
3 Comments
 
LVL 4

Expert Comment

by:vvk
ID: 36525590
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
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 36525957
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
 
LVL 13

Author Closing Comment

by:Torrwin
ID: 36526364
Thanks, the RawToHex and HexToRaw functions were exactly what I needed.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Exit the loop 4 43
Oracle SQL - Query help 7 56
Set value of dynamically created checkboxlist 2 34
VB.Net/LINQ: ".Contains" condition not finding existing result in MSSQL 16 36
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question