SQL/MX 3.1 Reference Manual (H06.23+, J06.12+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.1 Reference Manual663850-001
9-179
Considerations
All positive values have a leading space, for example:
TO_CHAR(12, ‘99’) has a leading space in the output, ‘ 12’.
V multiplies the input values by 10^n, where n is the number of 9s following V. For
example, if the input is 12 and the format-value is 99V999, the output is
‘ 12000’.
The PR element must appear at the end of the format-value , for example:
°
TO_CHAR(-12, ‘99PR’) has a valid format-value
°
TO_CHAR(-12, ‘PR99’) has an invalid format-value as the element PR
does not appear at the end of the format-value
The elements S, MI, or PR must precede the elements C, L, or U at the beginning
and must succeed at the end in the format-value , for example:
°
TO_CHAR(12, ‘SC99’) or TO_CHAR(12, ‘99CS’) has a valid format-value
°
TO_CHAR(12, ‘CS9’) or TO_CHAR(12, ‘99SC’) has an invalid format-value
The RN element converts numbers from 1 through 3999 to roman numerals. All
other values will have the output of # sign, for example:
°
TO_CHAR(12, ‘RN’) produces the output ‘XII’
°
TO_CHAR(-12, ‘RN’) produces the output '###############'
°
TO_CHAR(2585, ‘rn’) produces the output ‘mmdlxxxv’
A FM (Fill-Mode) modifier can be applied to a format-value to control blank
padding, for example:
TO_CHAR( 32, ‘FM9999’) has the output, ‘32’ with no leading space.