Browse Prior Art Database

Method for Storing Large Objects in a Relational Database

IP.com Disclosure Number: IPCOM000109507D
Original Publication Date: 1992-Sep-01
Included in the Prior Art Database: 2005-Mar-24
Document File: 4 page(s) / 181K

Publishing Venue

IBM

Related People

Burns, NA: AUTHOR

Abstract

Traditional relational database systems do not normally provide datatypes for large binary objects such as digitized images and audio soundtracks. This article reveals a method for using traditional datatypes for storing these large objects and eliminating the need for adding new datatypes.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 49% of the total text.

Method for Storing Large Objects in a Relational Database

       Traditional relational database systems do not normally
provide datatypes for large binary objects such as digitized images
and audio soundtracks.  This article reveals a method for using
traditional datatypes for storing these large objects and eliminating
the need for adding new datatypes.

      Traditionally, relational database systems have emphasized the
need to store numeric and character-based data in a database.  The
integrity of the data values are assured by the database management
system.  The database management system also maintains security by
only allowing authorized users to access each data item stored in the
database.

      As traditional transaction processing applications mature, they
are taking advantage of complex objects, such as digitized images and
audio segments.  Personnel databases that once had only numeric and
character-based data, such as employee name, address, department,
salary, etc., are now being expanded to include such things as
digitized photographs and digitized voice prints of the employee for
identification purposes.  Integrity and security are as important to
these datatypes as they are for the traditional numeric and
character-based datatypes.  Therefore, it is desirable to store the
large binary objects in the relational database rather than in
separate files.

      In order to store the large objects in a relational database
and take advantage of a database management system, some recent
relational database management systems have added a new datatype,
commonly called the BLOB (Binary Large Object), to the standardized
relational datatypes.  This article describes a method of using
traditional datatypes, thereby making the addition of any new
datatype unnecessary.
ADDING LARGE OBJECTS TO THE DATABASE SCHEMA

      A table can be defined to store images in a relational database
using the following SQL statement:
     CREATE TABLE IMAGES
                  (IMAGENAME CHAR(15) NOT NULL,
                   PAGENUMBER SMALLINT NOT NULL,
                   IMAGEPAGE LONG VARCHAR FOR BIT DATA
                   PRIMARY KEY (IMAGENAME, PAGENUMBER));
This statement will cause a table like that illustrated in the
following table to be defined in your database schema.
INSERTING LARGE OBJECTS INTO THE DATABASE

      Once the table has been created, data must be inserted into it.
This can be done with an application program using embedded SQL.
First, the image must be segmented into pages of up to 32,700 bytes.
Then, an embedded SQL statement can by used to actually store the
image segment into the database table.  The following psuedocode
illustrates the process needed to accomplish this task.
       set pointer = beginning of image buffer
       set name    = name of image
       set counter = 1
       while...