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.

    Requires Free Membership to View

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: