PL/SQL 命令简单总结

来源:互联网 发布:嵌入式软件开发怎么样 编辑:程序博客网 时间:2024/05/17 08:39

连接:conn 用户名/密码  conn scott/tiger

以系统身份 conn /as sysdba

断开连接 disconnect disc

修改密码: password

 

 

显示部分:

 

修改显示宽度 set linesize 120  ,off

修改显示高度 set pagesize 120

还有

ttitle , btitle

取消某一项的修改一般是set ??? off

 

改变一个列的现实方法:

column [column_name] heading [show_name] justify [ left|center| right ]

怎么变回来还不会……

lifeterminator原创,做人要厚道转载请注明此处

表的操作:

 

查看所有表和表空间

select table_name , tablespace_name from user_tables;

如果是 SYSDBA 的话可以:

select table_name , tablespace_name from user_tables;

 

查看一个表的结构:

desc describe [table_name]

 

拷贝一个表

create table new_table as select * from old_table

拷贝一个表,仅仅拷贝表结构

create table new_table as select * from old_table where 1=0

 

放入多个表中

insert all

when [判断表达式] then into [table_name] [ column_names] values [column_names]

when [判断表达式] then into [table_name] [ column_names] values [column_names]

select ....

其实和 insert 的用法差不多,划线部分一样