IBM Support

Suppress leading space from to_char function

Question & Answer


Question

How can I suppress the leading space returned when using the to_char function?

Answer

The to_char function is expected to return one or more leading spaces in the NPS database as well as other industry databases. To suppress the leading space(s), add the fm prefix.


Function without the fm Prefix

    SYSTEM(ADMIN)=> select length(to_char(12,'99'));
    LENGTH
    --------
    3
    (1 row)

Function with the fm Prefix
    SYSTEM(ADMIN)=> select length(to_char(12,'fm99'));

    LENGTH
    --------
    2
    (1 row)

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ575102

Document Information

Modified date:
17 October 2019

UID

swg21570727