Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BLOB data not correct while spooling and inserting the data

Sid_ Z.Dec 2 2016 — edited Dec 2 2016

Hi All,

I am using Oracle 11gR2.

I have a table with a BLOB column and I am generating the insert script from the table. The data is getting spooled but when I use that insert into other table

the BLOB is not exactly showing the data as it was expected.

What I am doing wrong with this? Could you please tell me the correct option.

Scripts as follows: I am using SQL Developer tool

create table t (x number , y blob);

Insert into t values (1, utl_raw.cast_to_raw('This is sample text for BLOB column in Oracle 11g.'));

Now the record is inserted into table T. Now I will spool the file as follows:

set long 10000

set line 1000

spool C:\ins.sql

select /*insert*/ * from t;

spool off

Now I can see my ins.sql file spooled with BLOB column as something like hexadecimal characters "633626A89BC090A0D56F........... And if I use that insert statement into table then the BLOB column is not shown correctly

It is showing some weird character instead "'This is sample text for BLOB column in Oracle 11g.'"

My question is how should I get the correct data whatever is in the BLOB column?

Regards,

Sid

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2016
Added on Dec 2 2016
6 comments
1,048 views