IBM Books

Image, Audio, and Video Extenders Administration and Programming

Manually cataloging an image

When you create a catalog, you indicate whether you want the Image Extender to automatically catalog an image when the image is stored in a user table. If an image is not automatically cataloged, you must manually catalog it after it is stored in the user table. You can manually catalog a single image or an entire column of images.

Manually cataloging a single image

Use the QbCatalogImage API to manually catalog a single image. You cannot catalog an image by command, because there is no way to identify the individual image on the command line. When you use the API, specify the catalog handle and the image handle (you can retrieve the image handle from the user table). The QBIC catalog must be open before you manually catalog an image.

For example, the following statements retrieve an image handle from a user table and then catalog the image:

/* Retrieve the image handle */
 
EXEC SQL BEGIN DECLARE SECTION;
char Img_hdl[251];
EXEC SQL END DECLARE SECTION;
 
QbCatalogHandle   CatHdl;
 
EXEC SQL SELECT PICTURE INTO :Img_hdl
  FROM EMPLOYEE
  WHERE NAME='Anita Jones';
 
/* Catalog the image*/
 
rc=QbCatalogImage(
                CatHdl,                              /* catalog handle */
                Img_hdl);                            /* image handle */

Manually cataloging a column of images

Use the QbCatalogColumn API or the CATALOG QBIC COLUMN command

to manually catalog a column of images. The Image Extender catalogs only images in the column that are newly inserted, updated, or deleted after the column was last cataloged. The Image Extender catalogs those images for all features in the catalog. The QBIC catalog must be open for update before you manually catalog a column of images.

Using the API: When you use the QbCatalogColumn API, specify the catalog handle. The Image Extender uses the images in the user table column that is associated with the specified catalog.

For example, the following API call catalogs the uncataloged images in a user table column that is associated with the specified catalog. The images are cataloged for all the features in the catalog:

QbCatalogHandle   CatHdl;
 
rc=QbCatalogColumn(
                CatHdl);                             /* catalog handle */

Using the command line: Use the CATALOG QBIC COLUMN command to manually catalog a column of images. You can also use the command to recatalog images (see Recataloging images). Specify the parameters FOR and NEW. (FOR and NEW are default parameters.)

In the following example, the command is used to catalog the uncataloged images in the table column that is associated with the currently-opened catalog. The images are cataloged for all the features in the catalog:

CATALOG QBIC COLUMN FOR NEW


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]