sql之26 using sql*plus

wmlm發表於2007-04-12
行編輯命令及檔案操作命令,在沒有PLSQL或TOAD圖形工具的情況下,就靠它混了[@more@]

行編輯命令

Command

Description

A[PPEND] text

Adds text to the end of the current line

C[HANGE] / old / new

Changes old text to new in the current line

C[HANGE] / text /

Deletes text from the current line

CL[EAR] BUFF[ER]

Deletes all lines from the SQL buffer

DEL

Deletes current line

DEL n

Deletes line n

DEL m n

Deletes lines m to n inclusive

I[NPUT]

Inserts an indefinite number of lines

I[NPUT] text

Inserts a line consisting of text

L[IST]

Lists all lines in the SQL buffer

L[IST] n

Lists one line (specified by n)

L[IST] m n

Lists a range of lines (m to n) inclusive

R[UN]

Displays and runs the current SQL statement in the buffer

n

Specifies the line to make the current line

n text

Replaces line n with text

0 text

Inserts a line before line 1

檔案操作命令

Command

Description

SAV[E] filename [.ext]

[REP[LACE]APP[END]]

Saves current contents of SQL buffer to a file. Use APPEND to add to an existing file; use REPLACE to overwrite an existing file. The default extension is .sql.

GET filename [.ext]

Writes the contents of a previously saved file to the SQL buffer. The default extension for the filename is .sql.

STA[RT] filename [.ext]

Runs a previously saved command file.

@ filename

Runs a previously saved command file (same as START).

ED[IT]

Invokes the editor and saves the buffer contents to a file named afiedt.buf.

ED[IT] [filename[.ext]]

Invokes the editor to edit contents of a saved file.

SPO[OL][filename[.ext]|OFF|OUT]

Stores query results in a file. OFF closes the spool file. OUT closes the spool file and sends the file results to the system printer.

EXIT

Leaves SQL*Plus.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-910179/,如需轉載,請註明出處,否則將追究法律責任。

相關文章