sqlplus 中的命令
describe /desc 查看表结构
list 查看缓冲区中的内容
SQL> list
1 select *
2 from scott.emp
3* where deptno=20
n 查看并定位到第n行
SQL> 2
2* from scott.emp
append 在当前行后追加命令
3* where deptno=20
SQL> append order by empno
3* where deptno=20 order by empno
i[nput] 在当前行后添加新行
SQL> list
1 select *
2 from scott.emp
3* where deptno=20
SQL> input order by empno;
SQL> list
1 select *
2 from scott.emp
3 where deptno=20
4* order by empno
c[hange] 在当行上替换修改
3* where deptno=20order by empno
SQL> c/20o/20 o
3* where deptno=20 order by empno
n text 替换第n行
SQL> list
1 select *
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> 1 select empno,ename,job,sal --替换第一行
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> 0 prompt "test" --在第一行之间插
SQL> list
1 prompt "test"
2 select empno,ename,job,sal
3 from scott.emp
4 where deptno=20
5* order by empno
del n m 删除缓冲区的行
SQL> list
1 prompt "test"
2 select empno,ename,job,sal
3 from scott.emp
4 where deptno=20
5* order by empno
SQL> del 1
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> del 2 4
SQL> list
1* select empno,ename,job,sal
run 或 / 运行缓冲区的内容
SQL> list
1* select empno,ename,job,sal from scott.emp
SQL> /
clear screen 清屏
host 或 ! 运行操作系统命令
host ls
host cp ...
host date
spool 将查询到的数据保存到指定文件
SQL> spool /home/oracle/date.txt
SQL> select * from scott.emp;
SQL> spool off;
--输出结束,这样就将 中间的一些语句产生的结果用文件保存起来
variable 定义绑定变量
SQL> variable a number
SQL> exec :a:=50
print 打印绑定变量
SQL> print
describe /desc 查看表结构
list 查看缓冲区中的内容
SQL> list
1 select *
2 from scott.emp
3* where deptno=20
n 查看并定位到第n行
SQL> 2
2* from scott.emp
append 在当前行后追加命令
3* where deptno=20
SQL> append order by empno
3* where deptno=20 order by empno
i[nput] 在当前行后添加新行
SQL> list
1 select *
2 from scott.emp
3* where deptno=20
SQL> input order by empno;
SQL> list
1 select *
2 from scott.emp
3 where deptno=20
4* order by empno
c[hange] 在当行上替换修改
3* where deptno=20order by empno
SQL> c/20o/20 o
3* where deptno=20 order by empno
n text 替换第n行
SQL> list
1 select *
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> 1 select empno,ename,job,sal --替换第一行
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> 0 prompt "test" --在第一行之间插
SQL> list
1 prompt "test"
2 select empno,ename,job,sal
3 from scott.emp
4 where deptno=20
5* order by empno
del n m 删除缓冲区的行
SQL> list
1 prompt "test"
2 select empno,ename,job,sal
3 from scott.emp
4 where deptno=20
5* order by empno
SQL> del 1
SQL> list
1 select empno,ename,job,sal
2 from scott.emp
3 where deptno=20
4* order by empno
SQL> del 2 4
SQL> list
1* select empno,ename,job,sal
run 或 / 运行缓冲区的内容
SQL> list
1* select empno,ename,job,sal from scott.emp
SQL> /
clear screen 清屏
host 或 ! 运行操作系统命令
host ls
host cp ...
host date
spool 将查询到的数据保存到指定文件
SQL> spool /home/oracle/date.txt
SQL> select * from scott.emp;
SQL> spool off;
--输出结束,这样就将 中间的一些语句产生的结果用文件保存起来
variable 定义绑定变量
SQL> variable a number
SQL> exec :a:=50
print 打印绑定变量
SQL> print
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21175589/viewspace-755486/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21175589/viewspace-755486/