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!

Insert a record with BLOB type

Y.RamletJan 14 2016 — edited Jan 14 2016

DB version: 11.2.0.4

OS      : Oracle Linux 6.6

Never worked with BLOBs, CLOBs before.

I would like to know how to store JPEG files in an Oracle table.

create table patient

(

pat_id number,

pat_name varchar2(100),

xray  blob

);

$ dd if=/dev/zero of=/tmp/someFile.jpeg bs=5M count=1

1+0 records in

1+0 records out

5242880 bytes (5.2 MB) copied, 0.0114732 s, 457 MB/s

I have created a dummy file with 5MB in size as shown above. Now, I want to store (INSERT) /tmp/someFile.jpeg file in patient table's XRAY column.

How can I do this ?

Question2.

What data type should I use if I want to store XML documents in a table column ? Is it BLOB ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2016
Added on Jan 14 2016
7 comments
1,669 views