SQL/PLUS Run Command
Append text;
Replace text Change/old text/new text
DELETE command DEL n --- Delete row
Delete buffer clear buffer -- delete all contents of the BUFFER
Add a statement INPUT text
Display the content in the buffer LIST [n/LAST] list last display the LAST row n is the nth row
Save command: You can use the ed (edit) command to directly call up Notepad to edit the buffer content,
Use save file_name to save the buffer content save c: \ buftest. SQL; default expansion name: SQL
RUN is also the content in the buffer zone;
Use the Start command to run the content inside the specified file. START file_name --- start c: \ q. SQL (the default extension name is SQL)
SQL/PLUS format the query result --- after which the query display will be modified, which can be cleared using COLUMN column_name clear
Set the alias: COLUMN oldname HEADING newname
FORMAT the COLUMN name of the query result: COLUMN column_name FORMAT dataformat -- if the maximum length is exceeded, the displayed characters will be replaced with #### (the number depends on the set display length)
Format
Description
9
Represents a numeric character
0
Display leading 0 or trailing 0 at the specified position
$
Dollar Currency symbol
B
Indicates an empty
MI
Show negative number
,
Display the thousands Separator
.
Show decimal point
G
Display the sub-location group symbol
L
Display currency symbols for the Region
Use the SET command to SET the format
Set pagesize n to 24 by default. Command: SHOW PAGESIZE
Set newpage n the number of spaces between each page is 1 by default. View command: SHOW NEWPAGE
Set linesize n SHOW LINESIZE
Display the time set timing on/OFF used to query data
SET whether the query result shows the column title set heading on/OFF.
SET whether the query result shows 'selected rows' set feedback on/OFF.
Use the SPOOL command to output the query results
SPOOL filename -- write location name C: \ test. SQL, and create this file in the default format of SLT
Select * from table_name;
Spool off -- it is the write time when it is disabled. If it is not executed, the C: \ test file is empty.
Display the query result set term on/OFF in SQL * PLUS -- only valid for SPOOL execution
SET TERM OFF
Spool testspool. SQL
@ C: \ TEST. SQL --- SQLPLUS: run the script in @ filename mode.
Spool off-end
Use TTITLE to set the title TTITLE 'title _ name' to insert a title title_name In the SPOOL output file
Add comments to statements in SQLPLUS
Use /*..... */Method
The REMARK command REMARK comment -- REMARK command is used to tell SQLPLUS that what follows is not a command but a text
Spool c: \ test. SQL
REMART 'test info' -- if you want to write comments to files, you must enter the comments after the spool command.
SELECT * from test;
From Xwin1989