DELIMIT_NAME scalar function

The DELIMIT_NAME function returns a name with delimiters if the delimiters are needed for use in an SQL statement.

Read syntax diagramSkip visual syntax diagramDELIMIT_NAME(name)
The schema is QSYS2.
name
A character or graphic string expression that identifies a name. The string must contain only characters allowed in an SQL identifier. If the string is longer that 128 characters, it will be truncated to 128 characters.

The result of the function is a varying length character string that contains name correctly delimited. This includes delimiting reserved words. If name is the null value or an empty string, null is returned.

Example

  • Delimit these names:
     VALUES DELIMIT_NAME('ABC'), 
            DELIMIT_NAME('abc'),
            DELIMIT_NAME('test"name'),
            DELIMIT_NAME('test''name2'),
            DELIMIT_NAME('NEW')
    
    Returns the values:
     ABC                
    "abc"              
    "test""name"       
    "test'name2"       
    "NEW"