December 2002
Intermediate to advanced
928 pages
85h 29m
English
Character strings are formatted using only one element, A, followed by a number specifying the column width in terms of characters. For example:
SQL>COLUMN a FORMAT A40SQL>SELECT 'An apple a day keeps the doctor away.' A2FROM dual;A ---------------------------------------- An apple a day keeps the doctor away.
By default, longer text values are wrapped within the column. You can use the WORD_WRAPPED, WRAPPED, and TRUNCATED parameters of the COLUMN command to control whether and how wrapping occurs. For example:
SQL>COLUMN a FORMAT A18 WORD_WRAPPEDSQL>SELECT 'An apple a day keeps the doctor away.' A2FROM dual;A ------------------ An apple a day keeps the doctor away.
When text columns wrap to multiple lines, SQL*Plus prints a blank line called a record separator following the record. Use SET RECSEP OFF to prevent that behavior.
When used with the ACCEPT command, a character format defines the maximum number of characters SQL*Plus will accept from the user.