AS400 SQL: REPLACE

REPLACE will replace a set characters in a String ro another set of Characters

Examples:


SELECT CHAR(REPLACE('DINING','N','VID'),10)
     
FROM SYSIBM.SYSDUMMY1:  
The result is the string 'DIVIDIVIDG'.

SELECT REPLACE('ABCXYZ','ABC','')
     
FROM SYSIBM.SYSDUMMY1:  
The result is the string 'XYZ'.

SELECT REPLACE('ABCCABCC','ABC','AB')
     
FROM SYSIBM.SYSDUMMY1

Comments

Popular posts from this blog

AS400 : Add a new line in text in email SNDSMTPEMM

AS400 Display: Radio Button (SNGCHCFLD)

AS400 Display File: Check Box (MLTCHCFLD)