Start a new topic

Import HEX into a BLOB

[This topic is migrated from our old forums. The original author name has been removed]

I have exported a BLOB in DBVis using the SQL format and specified to export the BLOB as HEX values. The problem is now that I cannot import the data anymore (Oracle says exceeding length) with that SQL statement. I have now deleted the HEX data from the BLOB from the SQL statement and imported. Afterwards I tried to edit the BLOB field and paste the hex contents into the editor. The problem is that the cell editor is only accepting text and not hex values. How can I import hex values of a BLOB back into the DB (Oracle) ? Edited by: clan on 27.08.2013 15:21

[This reply is migrated from our old forums.]

Re: Import HEX into a BLOB
Hi, What exact error do you get from Oracle? There is no hex to binary converter in the import feature in DbVisualizer i.e. import of hex is not supported. Unless Oracle does something magic with the data being inserted which I doubt. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Import HEX into a BLOB
Here is the error message: 15:40:17 [INSERT - 0 row(s), 0.000 secs] [Error Code: 1704, SQL State: 42000] ORA-01704: Zeichenfolge zu lang Why are you proposing an export to HEX values when there is no function to import exact that HEX value. Is not there a way to import with java a BLOB into the field ? Or to rephrase why can I import text values and not HEX values with DBViz of the same siye ? Paste with the cell editor as text is possible.
[This reply is migrated from our old forums.]

Re: Import HEX into a BLOB
Hi, What version of Oracle and the JDBC driver are you using? Easiest to find out is to right-click in the Connection Message in the Connection tab and chose Copy. Then paste in the reply. Export as HEX is just one of several formats that is supported by the export features. Import only supports CSV files (with the addition to also read external data in external file). It would be great if you can enable debug of DbVisualizer in Tools->Debug Window and then run the import again. Then we will see exactly what is going on. Post or email the debug log. Regards Roger support@dbvis.com
[This reply is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

Re: Import HEX into a BLOB
I am working with: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning option Oracle JDBC driver 11.1.0.7.0-Production Here is the debug output as an attachment.
[This reply is migrated from our old forums.]

Re: Import HEX into a BLOB
Hi, Thanks! It seems you are trying to execute a INSERT statement with all the values specified as literals. There are several problems here. The first is that Oracle only support up to 4000 characters as a string literal independent if you are using a BLOB/CLOB or character target data type. The value you have specified is more than 7800 characters. This is the problem reported you get as ORA-1704. The table data editor and the import features in DbVisualizer use the parameter binding in Oracle to overcome the 4000 character limitation. The second problem is that you have passed the hex encoded string as the BLOB value. I suspect you are rather looking into converting the hex code to its raw representation? If you convert (can unfortunately not be done in DbVisualizer) it and then pass the decoded data for the blob in the INSERT statement it will most likely work. Regards Roger
[This reply is migrated from our old forums.]

Re: Import HEX into a BLOB
Hi, You may also want to read the section of the Users Guide regarding export/import of BLOB data: http://www.dbvis.com/doc/main/doc/ug/exportImport/exportImport.html#mozTocId103889 Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: Import HEX into a BLOB
Thanks allot. In future I will never use hex format with the export command so that an import afterwards is possible.