Select localized values for a property

You can use the locale function to select localized values from the source object.

The locale function is case-sensitive, and all letters are lowercase. The number of positions defines the number of numbered columns that are returned in the results. The locale function returns localized values that are based on the locale selections.

The query results are the property name with a position number suffix, such as property_1, property_2, property_3. The values that are populated in the positions are the localized values matching the locale code, or a search list locale code, for each position.

If the data object does not contain localized values, then the property’s string value is returned in position1.The remaining position columns are empty.

Syntax

SELECT locale(localizedproperty, number of positions) FROM object

Example 1

The Data Catalog has five locale selections: 1 for en_US, 2 for es_ES, 3 for fr_FR, 4 for cz_cz, and 5 for nl_NL. If five positions are selected, then these values are returned:

  • greeting_1 for English
  • greeting_2 for Spanish
  • greeting_3 for French
  • greeting_4 for Czech
  • greeting_5 for Dutch

Syntax

SELECT Id, locale(greeting,5) from common_greetings

This table shows the common greetings that correspond for each value returned:

Id greeting_1 greeting_2 greeting_3 greeting_4 greeting_5

1

hello

hola

bonjour

ahoj

hallo

Example 2

In this example, the Data Catalog has only three locale selections: 1 for en_US, 2 for fr_FR, and 3 for es_ES. If five positions are selected, then these values are returned:

  • greeting_1 for English
  • greeting_2 for Spanish
  • greeting_3 for French greeting_4 and greeting_5 is null because no locales are defined for positions 4 and 5.

Syntax

SELECT Id, locale(greeting,5) from common_greetings

This table shows the common greetings that correspond for each value returned:

Id greeting_1 greeting_2 greeting_3 greeting_4 greeting_5

1

hello

hola

bonjour