SQLPlus Command Usage Guide (2)

xiaoxiao2021-03-06  25

/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------

/ * Welcome to reprint, please keep this part of this information

/ * Weng Yan 2004-1-15

/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------

Five report production orders

Report making commands are the most important SQL * Plus command, but also DBA is often used. Let me simply explain it.

(1) TTITLE command

Place a title of a report.

grammar:

Ttitle

--------

Places and Formats a title at the top of each report page.

ENTER TTITLE with no clause to list its current defi1.

The old form of ttitle is buy @ly a single word or

A string in quotes Follows the Ttitle Command.

TTI [TLE] [PRINTSPEC [Text | Variable] ...] | [ON | OFF]

WHERE PRINTSPEC IS One or More of the Following Clauses:

COL N le [ft] bold

S [kip] [N] CE [nter] format text

Tab N r [IGHT]

Description of the main parameters:

¨ 报 The location of the report title, there is Left, Center decision

¨ You can also use the user's variable (content with system to maintain), such as SQL.PNO page number, sql.lno line number, etc.

¨ Col [n] is to display the title in the first few character positions.

(2) Column command

This command is mainly used, which is the output format of the result of the query. The output format includes a number or the width of the display. After the Column is set, it remains valid. Unless you re-use the column settings or with Column Clear.

grammar:

Column

--------

Specifies Display Attributes for a Given Column, Such as:

- Column Heading Text

- Column Heading Alignment

- Number Data Format

- Column Data Wrapping

Also Lists The Current Display Attributes for a Single Column

OR all columns.

Col [umn] [{colorn | evr} [option ...]]

WHERE OPTION IS One of The Following Clauses:

Ali [as] alias

CLE [AR]

ENTMAP {on | OFF}

Fold_a [fter]

Fold_b [efore]

For [Mat] Format

HEA [ding] text

Jus [TIFY] {L [EFT] | C [ENTER] | C [Entre] | R [IGHT]}

Like {EXPR | alias}

Newl [ine]

New_v [alue] Variable

NOPRI [NT] | PRI [NT]

NUL [l] text

Old_v [alue] Variable

ON | OFF

WRA [PPED] | WOR [D_Wrapped] | TRU [ncated] is illustrated below:

SQL> Column Sal Alias ​​Salary Format $ 99,990.90

We specified a monk display format of the SAL this column and a number, the following display results showed the settings after setting.

figure 1

About Format Tips:

¨ 文 All sets of texts, represented by A [N], n represents the length of the display. Then the display length of this literal is in accordance with the width of n characters, if content> n, it will automatically go. Figure 2

¨ Date format, SQLPLUS default date format is displayed in NLS_LANG settings. The default is A9. Then you can set the date display by setting the database, or the environment variable of SQLPlus, or use the alter session command; or convert the display content by To_CHAR; you can also use the column command to specify the display length.

¨ Digital format illustrate some common symbols. Figure 3

9 represents a numeric character

0 Display the preamble 0 or rear 0 at the specified location

$ USD currency symbol

B shows an empty, if it is 0

Mi shows the negative, if less than 0

, Display thousand points separator

. Display decimal point

G and, like, display thousand points group symbols

L Show currency symbols in local area

figure 2

image 3

Tips for other parameters

Justify mainly specifies the alignment of the column display. Left, right, center.

LIKE Specifies the display of the display to the display method for some other column. Such as: Column Comm Like Sal

New Line wraps display this column content

NULL text If it is null, a string is displayed, which is equivalent to the ISNULL function.

Sustainable continued. . . .

转载请注明原文地址:https://www.9cbs.com/read-65160.html

New Post(0)