insert into table1(name) select 'table1'||name from table2
解决方案 »
- Oracle DBLink操作表权限问题
- oracle的timestamp问题
- PL/SQL程序中如何获取另外一台主机的系统时间(非本地主机)?
- 这句插入语句错在哪里? INSERT INTO TB_ACTIVE (uid, environ, time) VALUES (201378615, 0, Sun Jul 16 23:59:58 CST 2006)
- oracle 10g有没有9i那样的客户端?该如何配置使能用pl/sql连接??
- 简单问题
- 救命呀,我的无法安装oracle9i?
- oci里面能不能调用pl\sql啊? 能的话 给个例子吧
- 把timestamp类型的值减去3分钟,怎么操作?
- ●●请介绍几本Oracle入门的经典书●●
- 菜鸟问题:怎样更新视图里的数据?
- 我写的这个语句很慢!请问是什么原因
你desc一下就知道了
ALL_TABLES: Description of tables accessible to the user
ALL_COL_COMMENTS :COMMENTS Comments on columns of accessible tables and views
create or replace procedure name_pro
as
cursor t_sor is
select name1,name2,.. from table2;
begin
for v_sor in t_sor loop
insert into table1 (name1,name2,...) values('table1-'||v_sor.name1,'table1-'||v_sor.name2,...);
end loop;
end;
/
SQL>execute name_pro;
如果你不想上面的过程保存在数据中的话,可以修改成
declare
cursor t_sor is
select name1,name2,.. from table2;
begin
for v_sor in t_sor loop
insert into table1 (name1,name2,...) values('table1-'||v_sor.name1,'table1-'||v_sor.name2,...);
end loop;
end;
/
当然你也可以用完了以后把它删掉(drop)