Problem solve Get help with specific problems with your technologies, process and projects.

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.

Dig Deeper on Oracle database backup and recovery