Release 10.1A: OpenEdge Data Management:
SQL Reference

> ## PRO_ELEMENT function

> Extracts one or more elements from an array column and returns the `NVARCHAR` or `VARCHAR` string between the specified positions, including any internal separator characters and any internal escape characters.

> #### Syntax

>     PRO_ELEMENT ( 'array_style_expression', start_position, end_position ) ;

> `array_style_expression`

> A string of data type `VARCHAR` or `CHAR`, with a semicolon ( ; ) separating each element of the array.

> `start_position`

> The position in the string marking the beginning of the element `PRO_ELEMENT` is to extract.

> `end_position`

> The position in the string marking the end of the element to be extracted.

> Examples

> The following example returns the string '`bb`':

>     PRO_ELEMENT('aa;bb;cc', 2, 2) ;

> The next example returns the string '`aa;bb`':

>     PRO_ELEMENT('aa;bb;cc', 1, 2) ;

> The third example returns the string '`aa~;aa`':

>     PRO_ELEMENT('aa~;aa;bb;cc', 1, 1) ;

> #### Notes

> - The `array_style_expression` must be data type `NVARCHAR`, `VARCHAR`, or `CHAR`.

> - The returned string does not include the leading separator of the first element, or the trailing separator ( ; ) of the last element.

> - Even if you are extracting only one element, the escape characters are included in the result.

> - You must invoke `PRO_ARR_DESCAPE` to remove any escape characters.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095