At the data element level, CS_LOCALE defines localization values for a specific data element, for example, a bind variable.
An application needs to define localization values at the data element level only if the existing connection’s values are not acceptable.
For example, suppose a connection is using a U.S. English locale (U.S. English language, iso_1 character set, and appropriate datetime formats), but the connection needs to display a datetime result column using French day and month names.
The application:
Calls cs_loc_alloc to allocate a CS_LOCALE structure.
Calls cs_locale to load the CS_LOCALE structure with French datetime formats.
Calls cs_dt_info to customize the CS_LOCALE structure’s datetime conversion format.
Calls ct_bind to bind the result column to a character variable. The CS_DATAFMT structure that describes the bind variable must reference the French CS_LOCALE.
When the application calls ct_fetch, the datetime value in the result column is automatically converted to a character string containing French days and months and copied into the bound variable.