易截截图软件、单文件、免安装、纯绿色、仅160KB

如何在Oracle中复制表结构和表数据

1. 复制表结构及其数据:
create table table_name_new as select * from table_name_old
2. 只复制表结构:
create table table_name_new as select * from table_name_old where
1=2;
或者:
create table table_name_new like table_name_old
3. 只复制表数据:
如果两个表结构一样:
insert into table_name_new select * from table_name_old
如果两个表结构不一样:
insert into
table_name_new(column1,column2...) select column1,column2...
from table_name_old


相关文档:

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

Oracle 触发器

create or replace trigger InsertEdcTerminal
after INSERT on edc_terminal
FOR EACH ROW
DECLARE
merchantId char(15);
terminalId char(8);
uservalue char(6) ;
updatedate char(8);
updatetime char(6);
v_cardtype Merchant_Card.Card_Type%TYPE;
v_cardstate merchant_card.card_stat%TYPE;
v_banktyp ......

玩转Oracle(5)

||-------  数据库管理  -------||
//显示初始化参数
show parameter;
//数据库表的逻辑备份与恢复
//导出
1.导出表
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.导出其他方案的表,首先要确认自己是sysdba身份
exp userid=system@919959ORCL tables=(scott.emp) file=d:\e1.d ......

玩转Oracle(6)

||-------  维护数据完整性  -------||
【约束】
//约束
not null //非空
unique  //唯一 不能重复,但可以为空
primary key //主键
foreign key //外键
check  //满足条件
//商店售货系统表设计案例(1)
//goods 商品表
goodsid   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号