oracle 一张表插入另外一张表 存储过程

----创建存储过程
create or replace procedure inserttest as
cursor cs is
select id, name, cla, addr, phone, tel, x, y, shape, objectid
from hotel_bak t2;
begin
for c in cs loop
BEGIN
insert into hotel
(id, name, cla, addr, phone, tel, x, y, shape, objectid)
values
((select max(id) + from hotel),
c.name,
c.cla,
c.addr,
c.phone,
c.tel,
c.x,
c.y,
c.shape,
(select max(objectid) + from hotel));
END;
end loop;
end inserttest; ---执行存储过程
call inserttest(); commit;
上一篇:AppPoolService-IIS应用程序池辅助类(C#控制应用程序池操作)


下一篇:mysql 安装 linux系统下