Name
SET NUMWIDTH
Synopsis
The NUMWIDTH setting controls the default width used when displaying numeric values.
Syntax
SET NUM[WIDTH] widthParemeters
- SET NUM[WIDTH]
Is the command, which may be abbreviated SET NUM.
- width
Is the default column width used when displaying a numeric value.
Examples
The default NUMWIDTH setting is 10. NUMWIDTH is used only when no other settings apply. The following example shows the effect of setting NUMWIDTH to 5:
SQL> SET NUMWIDTH 5 SQL> SELECT 123 FROM dual; 123 ---- 123
A numeric format specified by a COLUMN command or by a SET NUMFORMAT command will override NUMWIDTH. The following example shows this:
SQL> SET NUMWIDTH 5 SQL> SET NUMFORMAT 999,999.99 SQL> SELECT 123 FROM dual; 123 ----------- 123.00 SQL> SHOW NUMWIDTH numwidth 5
NUMWIDTH is still five, but that value is ignored because the NUMFORMAT setting takes precedence. A long column title can cause NUMWIDTH to be ignored:
SQL> SET NUMWIDTH 5 SQL> SET NUMFORMAT "" SQL> COLUMN a HEADING "This is a long column title" SQL> SELECT 123 a FROM dual; This is a long column title --------------------------- 123
The column title takes precedence over NUMWIDTH when it comes to determining the width of the column.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access