PREFIX
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns the substring of a character string, starting from the position specified by start_pos and ending before the specified character.
Syntax
|
Parameters
- char_expression
-
Evaluates to a character string, typically a character‑string literal or column name. If the expression evaluates to
NULL,PREFIXreturnsNULL. - start_pos
-
Evaluates to an integer value.
PREFIXsearches the string specified in the first argument starting at that position. A value of1indicates the first character of the string. - char_expression
-
Evaluates to a single character.
PREFIXreturns the substring that ends before that character. IfPREFIXdoes not find the character, it returns the substring beginning at start_pos, to the end of the string. If the expression evaluates to more than one character,PREFIXignores all but the first character.
Notes
Each char_expression and
the result can contain multi‑byte characters. The start_pos argument
specifies the character position, not a byte position. Character
comparisons are case sensitive and are determined by sort weights
in the collation table in the database.
Example
The
following example shows one way to use the PREFIX function:
|
Compatibility
Progress extension