Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

CHOOSE

CHOOSE

Chooses a string from a list of strings based on a given position. You specify the position and the value. If the value matches the position,
Data Integration
returns the value.

Syntax

CHOOSE(
index, string1
, [
string2
, ...,
stringN
] )
Argument
Required/
Optional
Description
index
Required
Numeric datatype. Enter a number based on the position of the value you want to match.
string
Required
Any character value.

Return Value

The string that matches the position of the index value.
NULL if no string matches the position of the index value.

Example

The following expression returns the string ‘flashlight’ based on an index value of 2:
CHOOSE( 2, 'knife', 'flashlight', 'diving hood' )
The following expression returns NULL based on an index value of 4:
CHOOSE( 4, 'knife', 'flashlight', 'diving hood' )
CHOOSE returns NULL because the expression does not contain a fourth argument.

0 COMMENTS

We’d like to hear from you!