Storing images in an Oracle database

How can I store images in an Oracle database directly from a scanner? I used a form to view the image after scanned it, and now I want to insert it directly into my database.
To store your binary images in an Oracle database, you will need to create a column in your table defined with the BLOB datatype. BLOB stands for Binary Large Object. Images from scanners, mpeg files, movie files and so on can all be stored in the BLOB column. An example of creating a table with a BLOB column can be seen below:
CREATE TABLE test_table (
   id NUMBER,
   image BLOB);
The trick now is get your application to store the image in the table. The Oracle Application Developer's Guide -- Large Objects contains step-by-step examples for PL/SQL, OCI and Pro*C application development platforms.

If you are using Oracle Forms as your development platform, then there are two functions in Forms that are of interest

to you, READ_IMAGE_FILE and WRITE_IMAGE_FILE. Rather than reinvent the wheel, I'll send you to one of the best resources around, AskTom.

This was first published in May 2005

Dig deeper on Oracle database backup and recovery



Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: