ORA-08443: syntax error in BLANK WHEN ZERO clause in mask options
Cause: A syntax error was found in the BLANK WHEN ZERO clause in the mask options parameter passed to a UTL_PG conversion routine. Valid specifications are: BLANK ZERO BLANK ZEROS BLANK ZEROES BLANK WHEN ZERO BLANK WHEN ZEROS BLANK WHEN ZEROES
Action: Correct the mask options parameter.
ORA-08443表示用户在执行带有MASK选项的SQL语句,其中指定了BLANK WHEN ZERO子句时,有语法错误。
SELECT
amount,
REPLACE (
TO_CHAR (amount, ‘999,990.99’),
‘,’,
‘ ‘)
FORM my_table;
1. 使用CASE语句和NVL函数:
SELECT
CASE WHEN amount = 0
THEN 0
ELSE TO_CHAR (amount, ‘999,990.99’)
END
FORM my_table;
2. 使用NVL函数:
SELECT
NVL (TO_CHAR (amount, ‘999,990.99’), 0)
FORM my_table;