29. 4. 2. Formatting Columns |
|
COLUMN command formats the display of column headings and column data. |
The simplified syntax for the COLUMN command is as follows: |
COL[UMN] {column | alias} [options] |
where |
- column specifies the column name.
- alias specifies the column alias to be formatted. You can then reference your alias in the COLUMN command.
- options specifies one or more options to be used to format the column or alias.
- There are a number of options you can use with the COLUMN command.
|
The following table shows some of these options. |
Option | Description | FOR[MAT] format | Sets the format for the display of the column or alias to that specified in the format string. | HEA[DING] heading | Sets the text for the heading of the column or alias to that specified in the heading string. | JUS[TIFY] [{ left | center | right }] | Aligns the column output to the left, center, or right. | WRA[PPED] | Wraps the end of a string onto the next line of output. This option may cause individual words to be split across multiple lines. | WOR[D_WRAPPED] | Similar to the WRAPPED option except that individual words aren't split across two lines. | CLE[AR] | Clears any formatting of columns (sets the formatting back to the default). |
|
The format string in the previous table may take a number of formatting parameters. |
The parameters you specify depend on the data stored in your column: |
- If your column contains characters, you can use Ax to format the characters, where x specifies the width for the characters. For example, A12 sets the width to 12 characters.
- If your column contains numbers, you can use any of the number formats. For example, $99.99 sets the format to a dollar sign, followed by two digits, the decimal point, and another two digits.
- If your column contains a date, you can use any of the date formats. For example, MM-DD-YYYY sets the format to a two-digit month (MM), a two-digit day (DD), and a four-digit year (YYYY).
|
Advanced SQL Functions in Oracle 10g (Wordware Applications Library) |
(Paperback) |
by Richard Earp (Author) |
# Paperback: 350 pages |
# Publisher: Wordware Publishing, Inc. (January 25, 2006) |
# Language: English |
# ISBN-10: 1598220217 |
# ISBN-13: 978-1598220216 |