Progress
SQL-92
Guide and Reference


SUFFIX Function

Returns the substring of a character string starting after the position specified by start_pos and the second char_expression, to the end of the string.

SYNTAX

SUFFIX (char_expression , start_pos , char_expression ) 

char_expression

Evaluates to a character string, typically a character-string literal or column name. If the expression evaluates to null, SUFFIX returns null.

start_pos

Evaluates to an integer value. SUFFIX searches the string specified in the first argument starting at that position. A value of 1 indicates the first character of the string.

char_expression

Evaluates to a single character. SUFFIX returns the substring that begins with that character. If SUFFIX does not find the character after start_pos, it returns null. If the expression evaluates to more than one character, SUFFIX ignores all but the first character.

EXAMPLE

This example illustrates two ways to use the SUFFIX function:

SELECT C1, C2, SUFFIX(C1, 6, ’.’) FROM T1;
C1      C2 SUFFIX(C1,6,.
--      -- ------------- 
test.pref  .       
pref.test  s        
 
2 records selected 
 
 
SELECT C1, C2, SUFFIX(C1, 1, C2) FROM T1;
 
C1      C2 SUFFIX(C1,1,C
--      -- ------------- 
test.pref  . pref     
pref.test  s  t      
 
2 records selected 

NOTE

COMPATIBILITY

Progress Extension


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