Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Insert Blob Datatype Values in Oracle 11g Database Through SQL*Plus

I have created a table with Blob datatype but I do not know how to insert values into the table or view the table content using SQL*Plus. Please help me.

like image 332
user240677 Avatar asked Dec 09 '25 03:12

user240677


1 Answers

It depends on what kind of data you want put into a BLOB. Let's consider the table:

create table b1(id number , b blob);

If your data represented as hex-string you should use TO_BLOB function

insert into b1 values(1,to_blob('FF3311121212EE3a'));

SQLPLUS also shows BLOBs as hex-string

select * from b1;

----- -----------------------------------
   ID                                   B
----- -----------------------------------
    1 FF3311121212EE3A

Please refer Oracle documentation on Using LOBs

like image 166
Naeel Maqsudov Avatar answered Dec 10 '25 16:12

Naeel Maqsudov