oracle 一张表插入另外一张表 存储过程
时间:2021-07-01 10:21:17
帮助过:59人阅读
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) +
1 from hotel),
c.name,
c.cla,
c.addr,
c.phone,
c.tel,
c.x,
c.y,
c.shape,
(select max(objectid) +
1 from hotel));
END;
end loop;
end inserttest;
---
执行存储过程
call inserttest();
commit;
oracle 一张表插入另外一张表 存储过程
标签: