Oracle SQL Plus The Definitive Guide- P50 pps

10 175 0
Oracle SQL Plus The Definitive Guide- P50 pps

Đang tải... (xem toàn văn)

Thông tin tài liệu

< previous page page_453 next page > Page 453 TAB x¦ LE[FT]¦ CE[NTER]¦ R[IGHT]¦ BOLD¦ FOR[MAT] format_spec¦ text¦ variable] where: REPF[OOTER] May be abbreviated REPF. Issuing the REPFOOTER command with no parameters causes SQL*Plus to display the current report footer setting. OFF Turns the report footer off, but does not erase its definition. You can turn it back on again with ON. ON Turns on printing of report footers. COLx Causes any footer text following this parameter to print at the specified column position. S[KIP]x May be abbreviated to S, and inserts the specified number of line breaks before printing any subsequent footer text. TABx TAB is similar to COL, but moves you the specified number of columns relative to the current position. Negative numbers move you backwards. TAB has nothing whatsoever to do with tab characters. LE[FT] May be abbreviated LE, and causes subsequent footer text to be printed beginning at the leftmost column of the current footer line. CE[NTER] May be abbreviated CE, and causes subsequent footer text to be centered within the current line. The LINESIZE setting controls the line width. R[IGHT] May be abbreviated R, and causes subsequent footer text to be printed flush right. The LINESIZE setting controls where SQL*Plus thinks the right end of the line is. BOLD Makes a footer bold by printing it three times. Only text following the BOLD command is repeated on each line. There is not a NOBOLD parameter. < previous page page_453 next page > < previous page page_454 next page > Page 454 FOR[MAT] May be abbreviated to FOR, and allows you to control how subsequent numeric data in the footer is displayed. format_spec Is a string that specifies the display format to use for subsequent numeric data in the footer. The format elements you can use here are the same as for the COLUMN command, and are described in Appendix B. It is possible to specify a character format, such as A20, but that has no effect on subsequent character strings. text Is any text you want to have in the footer. To be safe, you should enclose this in quotes, but you don't have to as long as your title text doesn't include any keywords like BOLD or TAB that have meaning to REPFOOTER. Either single or double quotes may be used. If you need to include a quote as part of your text, use two quote characters back to back. variable May be one of the variables shown in Table A-1, which is shown under the BTITLE command. Repheader The REPHEADER command defines a report header. Report headers print on the first page of a report, after the page title and before the first detail line. See Chapter 3 for more information. REPH[EADER] [OFF¦ON] [COL x¦ S[KIP] x¦ TAB x¦ LE[FT] ¦ CE[NTER] ¦ R[IGHT] ¦ BOLD¦ FOR[MAT} format_spec¦ text¦ variable] where: REPH[EADER] May be abbreviated REPH. Issuing the REPHEADER command with no parameters causes SQL*Plus to display the current report header setting. < previous page page_454 next page > < previous page page_455 next page > Page 455 OFF Turns the report header off, but does not erase its definition. You can turn it back on again with ON. ON Turns on printing of report headers. COLx Causes any header text following this parameter to print at the specified column position. S[KIP]x May be abbreviated to S, and inserts the specified number of line breaks before printing any subsequent footer text. TABx TAB is similar to COL, but moves you the specified number of columns relative to the current position. Negative numbers move you backwards. TAB has nothing whatsoever to do with tab characters. LE[FT] May be abbreviated LE, and causes subsequent footer text to be printed beginning at the leftmost column of the current footer line. CE[NTER] May be abbreviated CE, and causes subsequent header text to be centered within the current line. The LINESIZE setting controls the line width. R[IGHT] May be abbreviated R, and causes subsequent header text to be printed flush right. The LINESIZE setting controls where SQL*Plus thinks the right end of the line is. BOLD Makes a footer bold by printing it three times. Only text following the BOLD command is repeated on each line. There is not a NOBOLD parameter. FOR[MAT] May be abbreviated to FOR, and allows you to control how subsequent numeric data in the header is displayed. format_spec Is a string that specifies the display format to use for subsequent numeric data in the header. The format elements you can use here are the same as for the COLUMN command, and are described in Appendix B. It is possible to specify a character format, such as A20, but that has no effect on subsequent character strings. < previous page page_455 next page > < previous page page_456 next page > Page 456 text Is any text you want to have in the header. To be safe, you should enclose this in quotes, but you don't have to as long as your title text doesn't include any keywords like BOLD or TAB that have meaning to REPHEADER. Either single or double quotes may be used. If you need to include a quote as part of your text, use two quote characters back to back. variable May be one of the variables shown in Table A-1, which is shown under the BTITLE command. RUN. The RUN command displays and then executes the command currently in the SQL buffer. R[UN] where: R[UN] Is the command, which may be abbreviated to R. No parameters are necessary. RUN, and all the other editing commands, are described in Chapter 2. Save The SAVE command writes the contents of the SQL buffer to an operating-system file: SAV[E] filename [CRE[ATE]¦REP[LACE]¦APP[END]] where: SAV[E] Is the command, which may be abbreviated to SAV. filename Is the filename, including the path and extension, to which you want to write the buffer contents. CRE[ATE] Causes the operation to succeed only if the file does not already exist. This is the default setting. REP[LACE] Overwrites any existing file of the same name. < previous page page_456 next page > < previous page page_457 next page > Page 457 APP[END] Appends the contents of the buffer to the file. SAVE, and all the other editing commands, are described in Chapter 2. Set The SET command is used to change the value of the many internal settings that affect the operation of SQL*Plus: SET APPI[NFO] {OFF¦ON¦app_text} ARRAY[SIZE] array_size AUTO [COMMIT] {OFF¦ON¦IMMEDIATE¦statement_count} AUTOP[RINT] {OFF¦ON} AUTORECOVERY {OFF¦ON} AUTOT[RACE] {OFF¦ON¦TACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]] BLO[CKTERMINATOR] block_term_char BUF[FER] {buffer_name¦SQL} CLOSECUR[SOR] {OFF¦ON} CMSD{EP] {OFF¦ON¦separator_char COLSEP column_separator COM[PATIBILITY] {V7¦v8¦NATIVE} CON[CAT] {OFF¦ON¦concat_char} COPYC[OMMIT] batch_count COPYTYPECHECK {OFF¦ON} DEF[INE] {OFF¦ON¦prefix_char} DOC[UMENT] {ON¦OFF} ECHO {OFF¦ON} EDITF[ILE] edit_filename EMB[EDDED] {ON¦OFF} ESC[APE] {OFF¦ON¦escape_char} FEED[BACK]{OFF¦ON¦row_threshold} FLAGGER {OFF¦ENTRY¦INTERMED[IATE]¦FULL} FLU[SH] {OFF¦ON} HEA[DING] [ON¦OFF] HEADS[EP] heading_separator INSTANCE [service_name¦LOCAL] LIN[ESIZE] line_width LOBOF[FSET] offset LOGSOURCE logpath LONG long_length LONGC[HUNKSIZE] size MAXD[ATA] max_row_width NEP[AGE] {lines_to_print¦NONE} NULL null_text NUMF[ORMAT] format_spec NUM[WIDTH] width PAGES[IZE] lines_on_page PAU[SE] {ON¦OFF¦pause_message} RECSEP {WR[APPED]¦EA[CH]¦OFF} RECSEPCHAR separator_char SCAN {OFF¦ON} < previous page page_457 next page > < previous page page_458 next page > Page 458 SERVEROUT[PUT] {OFF¦ON} [SIZE buffer_size] [FOR[MAT] {WR[PPED] WOR [D_WRAPPED]¦TRU[NCATED] } SHIFT[INOUT] {VIS[IBLE]¦INV[ISIBLE]} SHOW[MODE] {ON¦OFF¦BOTH} SPACE num_of_spaces SQLBLANKLINES {OFF¦ON} SQLC[ASE] {MIXED¦UPPER¦LOWER} SQLCO[NTINUE] continuation_prompt SQLN[UMBER] {OFF¦ON} SQLPRE[FIX] prefix_char SQLP[PROMPT] prompt_text SQLT[ERMINATOR] {OFF¦ON¦term_char} SUF[FIX] extension TAB {OFF¦ON} TERM[OUT] {OFF¦on} TI[ME] {OFF¦ON} TIMI[NG] {OFF¦ON} TRIM[OUT] {ON¦OFF} TRIMS[POOL] {ON¦OFF} TRU[NCATE] {OFF¦ON} UND[ERLINE] {underline-char ¦ {ON¦OFF}} VER[IFY] {OFF¦ON} WRA[p] {ON¦OFF} Please see Chapter 11, Customizing Your SQL*Plus Environment, for detailed information about each of these settings. Show The SHOW command allows you to look at the current state of your SQL*Plus environment. You can use it to display the current value of any setting controlled by the SET command. SHOW may also be used to look at current page titles, page footers, and so forth. SHO[W] setting ALL BTI[TLE] ERR[ORS] [{FUNCTION¦PROCEDURE¦PACKAGE¦PACKAGE BODY¦ TRIGGER¦TYPE¦TYPE BODY¦view} [owner.] object_name] LNO PARAMETER [S] [parameter_name] PNO REL[EASE] REPF[OOTER] REPH[EADER] SGA SPOO[L] SQICODE TTI[TLE] USER < previous page page_458 next page > < previous page page_459 next page > Page 459 where: SHO[W] Is the command, which may be abbreviated to SHO. setting Is any one of the settings you can set using the SET command. ALL Shows everything, except for errors and the SGA. BTI[TLE] Displays the current page footer. ERR[ORS] Displays an error listing for a stored object. The command SHOW ERRORS by itself causes the error listing for the most recently created object to be displayed. You can get the error listing for a specific object by specifying the object type (function, procedure, and so forth) and the object name. FUNCTION ¦ PROCEDURE ¦ PACKAGE ¦ PACKAGE BODY ¦ TRIGGER ¦ TYPE ¦ TYPE BODY ¦ VIEW Used with SHOW ERRORS to specify the object type of interest. This is only necessary if you are specifying the name of the object. [owner.]object_name Used with SHOW ERRORS to name the object for which you want to display an error listing. LNO Displays the current line number. PARAMETER[S] [parameter_name] Displays the current value of one or more initialization parameters. Chapter 10 provides detailed examples of SHOW PARAMETERS in use. PNO Displays the current page number. REL[EASE] Displays the release number (the version) of the Oracle database to which you are connected. REPF[OOTER] Displays the current report footer. REPH[EADER] Displays the current report header. < previous page page_459 next page > < previous page page_460 next page > Page 460 SGA Displays information about the current state of the System Global Area. See Chapter 10 for more information about this option. SPOO[L] Tells you whether or not output is currently being spooled to a file. SQLCODE Displays the SQL code returned by the most recent SQL statement. TTI[TLE] Displays the current page title. USER Displays the current username. Shutdown The SHUTDOWN command allows you to close a database and stop an Oracle instance. Chapter 10 discusses this command. In order to use SHUTDOWN, you must be connected as SYSDBA, SYSOPER, or INTERNAL. SHUTDOWN [NORMAL¦IMMEDIATE¦TRansactional¦ABORT] where: SHUTDOWN Is the command, which may not be abbreviated. NORMAL Causes a normal shutdown to take place. New users are blocked from connecting. The database remains open until all currently connected users voluntarily disconnect. When the last user disconnects, the database files are closed, the database is dismounted, and the instance is stopped. IMMEDIATE Causes users to be summarily disconnected when their current SQL statement completes execution. Users not in the middle of executing a statement are disconnected immediately. As each remaining user's currently executing SQL statement completes, she is forcibly disconnected from the database. Any open transactions are rolled back, the database files are closed, the database is dismounted, and the instance is stopped. TRANSACTIONAL A compromise between NORMAL and IMMEDIATE. Users are allowed to finish their current transactions. As each user completes his current transaction, he is forcibly disconnected. When the last user disconnects, the database is closed, then dismounted, and finally the instance is stopped. < previous page page_460 next page > < previous page page_461 next page > Page 461 ABORT Is tantamount to pulling the plug on the server. All background processes are immediately aborted. Users are summarily disconnected. No rollback is done on open transactions, and dirty buffers are not written back to the disk. Crash recovery occurs the next time you start the database. This is the only shutdown option that does not leave the database files in a consistent state. Spool The SPOOL command is used to write output to a text file. You must use this if you are going to print a report. The only way to print a report is to spool it to a file, then print that file. See Chapter 3 for an example of SPOOL being used to generate a report file. SPOOL may also be used to generate a new file of SQL commands to be executed. Chapter 7 shows you how to take advantage of that powerful technique. SP[OOL] file_name¦OFF¦OUT where: SP[OOL] May be abbreviated to SP. file_name Is the name of the file to which you want to write the report. The default extension depends on the operating system, and will be either LST or LIS. Under Windows 95 and NT, it is LST. A path may be specified as part of the filename. OFF Turns spooling off. You must have turned spooling on before you can turn it off. OUT Turns spooling off, and prints the file on the default printer. This option is not available in the Windows versions of SQL*Plus. Start The START command functions the same way as the @ command, and is used to execute a SQL*Plus script file: STA[RT] script_file [argument] where: STA[RT] Is the command, which may be abbreviated to STA. < previous page page_461 next page > . 457 APP[END] Appends the contents of the buffer to the file. SAVE, and all the other editing commands, are described in Chapter 2. Set The SET command is used to change the value of the many internal. This option is not available in the Windows versions of SQL* Plus. Start The START command functions the same way as the @ command, and is used to execute a SQL* Plus script file: STA[RT] script_file. num_of_spaces SQLBLANKLINES {OFF¦ON} SQLC[ASE] {MIXED¦UPPER¦LOWER} SQLCO[NTINUE] continuation_prompt SQLN[UMBER] {OFF¦ON} SQLPRE[FIX] prefix_char SQLP[PROMPT] prompt_text SQLT[ERMINATOR]

Ngày đăng: 05/07/2014, 04:20

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan