Display formats

The display format (sometimes referred to as an end-user format) is the format in which data is displayed, and it differs from the internal format that is used to store the data in the database.

Display formats for data types

The database server stores data for DATE, DATETIME, MONEY, and numeric data types in compact internal formats within the database. For example, the database server stores a DATE value as an integer number of days since December 31, 1899, so the date 03/19/96 is 35142.

HCL® OneDB® products support display formats so that a client application can present internal formats in a form that is meaningful to the user. Literal strings or character variables can display in SQL statements as column values or as arguments of SQL API library functions.

The HCL OneDB product uses a display format when it encounters a string (a literal string or the value in a character variable) in these contexts:
  • When the HCL OneDB product reads a string, it uses a display format to determine how to interpret the string so that it can convert it to a numeric value.
    For example, suppose that DB-Access has the default (US English) as its client locale. The literal date in the following INSERT statement uses the display format for dates that the default locale defines:
    INSERT INTO mytab ( date1 ) VALUES ( '03/19/96' )

    When it receives the data from the client application, the database server uses the display format to interpret this literal date so that it can convert it to the corresponding internal format (35142).

  • When the HCL OneDB product prints a string, it uses a display format to determine how to format the numeric value as a string.

    For example, suppose that the client application has a French locale as its client locale, and this locale defines a date display format that formats dates as dd/mm/yy. The following rdatestr() function uses the display format for dates to obtain the value in the datestr character variable:

    err = rdatestr(jdate, datestr);

    The rdatestr() function uses the display format to determine how to format the internal format (35142) as a date string before it puts the value in the datestr variable.

A GLS locale defines display formats for the following types of data:
  • Representation of currency notation and numeric format
  • Representation of dates and of time-of-day values
You can specify number, currency, date, and time values in a display format that is specific to a given country or culture.
Important: Display formats of date, time, number, and monetary values do not affect the internal format of the corresponding data types in the database. They affect only how the client application displays the data and interprets data entry.
The following table lists the values that define the display format for each data type that uses display formats. For information about the locale categories, see Manage GLS files.
Data types Environment variables Locale category
DATE GL_DATE TIME
DATETIME

INTERVAL

GL_DATE

GL_DATETIME

TIME
MONEY DBMONEY MONETARY
Number (DEC, DECIMAL, DOUBLE PRECISION, FLOAT, INT, INT8, INTEGER, NUMERIC, REAL, SMALLFLOAT, SMALLINT) None NUMERIC

Display widths for Unicode private-use characters

By default, DB-Access and other HCL OneDB character-based applications cannot interpret private-use characters.

You must use the IFX_PUA_DISPLAY_MAPPING environment variable to set display widths for characters from the Unicode Private-Use Area (PUA) ranges according to a mapping file that you supply: $INFORMIXIDR/gls/etc/pua.map.