By
Published: 03 May 2005
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
Oracle expert Brian Peasland answers one reader's question about common pitfalls when connecting Oracle to outside programs.
Continue Reading
One reader asks expert Brian Peasland a question about datafile sizes with the Oracle RMAN duplicate 10g command.
Continue Reading
Managing parent table-child table relations in Oracle SQL environments is key to efficient programming.
Continue Reading