Home | Previous Page | Next Page   Database Server Features > Locale Support For C User-Defined Routines (IDS and DB API) >

Locale-Specific Data Formatting

When a C UDR handles strings that contain end-user formats for date, time, numeric, or monetary data, you must write the UDR so that it handles any locale-specific formats of these end-user formats. The DataBlade API provides functions that convert between the internal representation of several data types and its end-user format.

The following DataBlade API functions convert an internal database value to a string that uses the locale-specific end-user format.

DataBlade API Function Description
mi_date_to_string( ) Uses the locale-specific end-user date format to convert an internal DATE value to its string equivalent.
mi_money_to_string( ) Uses the locale-specific end-user monetary format to convert an internal MONEY value to its string equivalent.
mi_decimal_to_string( ) Uses the locale-specific end-user numeric format to convert an internal DECIMAL value to its string equivalent.

Important:
The mi_datetime_to_string( ) and mi_interval_to_string( ) functions do not format strings in the date and time formats of the current processing locale. Instead, they create a date, time, or interval string in a fixed ANSI SQL format.

The following DataBlade API functions interpret a string in its locale-specific end-user format and convert it to its internal database value.

DataBlade API Function Description
mi_string_to_date( ) Converts a string in its locale-specific date end-user format to its internal DATE format.
mi_string_to_money( ) Converts a string in its locale-specific currency end-user format to its internal MONEY format.
mi_string_to_decimal( ) Converts a string in its locale-specific numeric end-user format to its internal DECIMAL format.

Important:
The mi_string_to_datetime( ) and mi_string_to_interval( ) functions do not interpret the date and time formats of the current processing locale. Instead, they interpret the date/time or interval string in a fixed ANSI SQL format.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]