Skip to Main Content

APEX

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!

How to create a table to store blob pictures and display the pictures as per each primary key?

Johnny_420Mar 7 2017 — edited Mar 21 2017

Currently, I have an Pictures Folder with a list of user portraits in JPG format named after the user's primary key.

I would like to store them in a table so I can query them and display the picture next to their matching records.

I started the following and not sure where I was heading and what else I need to do. I have never dealt with BLOB and Bfile before so please give me some pointers.

Step 1:Create directory

CREATE DIRECTORY UPLOAD_PICTURES AS 'C:\pictures';

Step 2:Create Table

create table pictures (

  bfile_id varchar2(10),

  bfile_loc bfile)

  TABLESPACE users

  storage (initial 1m next 1m pctincrease 0)

Step 3:Insert into table

INSERT INTO pictures

VALUES('UID0006085',bfilename('UPLOAD_PICTURES','UID0006085.JPG'));

This post has been answered by PMON on Mar 7 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2017
Added on Mar 7 2017
2 comments
1,073 views