DSQL, PSQL

    Syntax

    Result type

    VARCHAR or BLOB

    Description

    Examples

    1. -- returns 'Waste no space'
    2. select trim (leading from ' Waste no space ') from rdb$database
    3. -- returns 'Waste no space '
    4. select trim (leading '.' from ' Waste no space ') from rdb$database
    5. -- returns ' Waste no space '
    6. select trim (trailing '!' from 'Help!!!!') from rdb$database
    7. -- returns 'Help'
    8. select trim ('la' from 'lalala I love you Ella') from rdb$database
    9. -- returns ' I love you El'
    10. select trim ('la' from 'Lalala I love you Ella') from rdb$database
    11. -- returns 'Lalala I love you El'

    Notes

    • The substring to be removed, if specified, may not be bigger than 32767 bytes. However, if this substring is repeated at str‘s head or tail, the total number of bytes removed may be far greater. (The restriction on the size of the substring will be lifted in Firebird 3.)

    When used on a BLOB, this function may need to load the entire object into memory. This may affect performance if huge BLOBs are involved.