Below query has output:
SELECT rpad(nvl('CA', ' '), 13)||rpad(nvl(to_char(TRUNC(12, 2),'9999.00') , ' '), 13)||rpad(nvl('95670', ' '), 6) FROM dual UNION ALL
SELECT rpad(nvl('NC', ' '), 13)||rpad(nvl(to_char(TRUNC(238.1, 2),'9999.00') , ' '), 13)||rpad(nvl('27895', ' '), 6) FROM dual UNION ALL
SELECT rpad(nvl('MO', ' '), 13)||rpad(nvl(to_char(TRUNC(1938, 2),'9999.00') , ' '), 13)||rpad(nvl('64484', ' '), 6) FROM dual ;
RPAD(NVL('CA',''),13)||RPAD(NVL
-------------------------------
CA 12.00 95670
NC 238.10 27895
MO 1938.00 64484
I'm trying address 2 issues:
- Numbers are starting at position 15 (expected 14)
- All numbers should start at position 14
Expected output:
CA 12.00 95670
NC 238.10 27895
MO 1938.00 64484
Working on:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Windows 11 Enterprise