Christian
Christian

Reputation: 22353

Save PDF-File into BLOB-Column Oracle DB with INSERT statement

I have to save a PDF-File into a BLOB-Column from a Oracle DB. I can't use Java and have to use an INSERT-Statement.

The only solutions I've found while searching were very complex.

Is there an easy solution like: INSERT INTO (BLOB_COLUMN) VALUES(BLOBPDF("myPDF.pdf") or something like that?

Upvotes: 1

Views: 30562

Answers (2)

bdn02
bdn02

Reputation: 1500

If the load is "one-shot" you can use SQLDeveloper. Otherwise you can use sqlloader (http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_params.htm) that is designed for this type of operations

Upvotes: 0

Egalitarian
Egalitarian

Reputation: 2228

I would suggest that you use a stored procedure in Oracle where you pass the path to your PDF file and calling the stored procedure does the insert.

Look at the last two sample example here.

Upvotes: 1

Related Questions