Specifying Image Field Attributes

Use Image fields to store application data that takes the form of images. Image fields are functionally no different from any other type of field. Just as end-users employ character fields to store names and addresses, they can employ image fields to keep track of all types of digital pictures. This field enables you to store pictures of assets, company logos (in SQL tables), or scanned images of employees (as part of their personal data rows).

Field or Control Description

Maximum Length

Specify the maximum number of bytes available to store an image. If you do not specify a maximum length, the maximum length is determined by your database platform. If a user attempts to cut and paste an image that is larger than the maximum length or database capacity, an error message appears.

The following databases apply these maximums:

  • Oracle (2 gigabytes).

  • Db2 for z/OS: Approximately 32700 kilobytes, depending on the page size, (as determined by the Buffer Pool) and the internal Db2 lengths of the rest of the columns in the row.

  • Microsoft SQL Server (2 gigabytes).

Image Format

Select an image format. The format specified on the field definition restricts valid images to that type only.

Image fields support BMP, CUT, DIB, GIF, EPS, JPG, PCT, PCX, PNG, RLE, TGA, and SVG formats. At runtime using the PeopleCode PeopleCode Language Reference: InsertImage function function, users can upload BMP, DIB, JPG, PNG, and SVG images to the database.

Note:

For the record that contains an image field, the record must have at least one key if the image field is to be displayed on a page. This is requirement so that unique image file names can be generated.

Note:

When using images of the SVG format, be sure that the XML declaration of the SVG image is of an expected format. For example:

<?xml version="1.0" encoding="utf-8"?>

or,

<?xml version="1.0" standalone="no"?>

If the XML declaration is not formatted correctly, this can result in errors, such as errors when creating the definition, not being able to view height and width in Application Designer, not being able to view the image at runtime, and so on.