Oracle Database class notes
sql plus command
l(ist)
Browse buffer file
n xx
replace the buffer n-th row
n
to set the current behavior of the n-th row
append
will be something written on the current line at the end of
del n
the n-th row delete buffer
c(hange)
modified when the line is something / xx (original) / xx (new)
save
the current buffer save the content area to the specified file (\ path \ path \ xx.xx)
get
the file into the buffer (\ path \ path \ xx.xx)
start
to run the script (\ path \ path \ xx.xx)! ! No semicolon no effect
spool
(\ path \ path \ xx.xx) will create a new file save screen stuff
spool off
from the spool (\ path \ path \ xx.xx) Spool off things start to save (including itself)
show all
to get all environment variables
show XX
get XX Example: show user User is "SCOTT"
echo on
run the script show off what the script does not show
set feed(back)
there will be feedback (default 6 lines) Example: 14 rows selected
set feedback off
close on open (by default)
set feedback 3
set the query to the meaning of the three lines of information when there will be feedback
set hea(ding){on|off}
title is displayed column (by default)
set array(size)
to set the number of rows retrieved (default 20 lines)
set long
is set to obtain the number of columns
set pagesize
to display a few lines of set number of pages in the
col(umn)
[{column name | alias} [options]]
col ename for(mat) a5
( the ename the column length is set to 5 (digital string aX X) exceeds the specified width wrap)
col sal for $999,999
(provided that the sal format and with the addition of 999,999 dollar sign)
col sal heading '工资'
(the head of the column name change sal as wages)
col sal
inquiry into what sal column settings
col sal clear
The format provided emptying col
col sal
See sal all formats
col sal heading(format)XX format(heading)
xx heading the format and mixing the same effect
select deptno || ‘,’ || dname || ‘,’ || loc from dept ;
(the connecting column, separated)
select deptno , dname , loc from dept ;
(in the form of three columns)