oracle操作。
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle操作。,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2354字,纯文字阅读大概需要4分钟。
内容图文
*
* 复制oracle表中任意一行,并改变相应的数列
* /
declare
cursor dept_cursor is select * from SCENE_PIC WHERE PICID=‘63563908576556815641‘;
begin
for dept_rs in dept_cursor
loop
dept_rs.PICID:=‘63563908576556815642‘;
exit when dept_cursor%notFound;
dept_rs.PICID:=null;
insert into ZQ values dept_rs;
end loop;
end;
/*
*
* 复制oracle表中任意一行,并改变相应的数列
* /
declare
begin
for rs in (select * from SCENE_PIC where PICID = ‘63563908576556815641‘)
loop
rs.PICID := ‘63563908576556815642‘;
insert into ZQ values rs;
end loop;
end;
/*
*
* 1到10 的平方
* /
declare
i number:=1;
begin
loop
dbms_output.put_line(i||‘的平方数为‘||i*i);
i:=i+1;
exit when i>10;
end loop;
end;
/*
*
* 复制scene_base表中的案件信息,修改scene_id,根据scene_id修改scnen_pic中的scene_id和pic_id
* /
declare
v_index number(2):=1;
v_oldId nvarchar2(50):=‘1‘;
begin
for c in (select * from scene_base where sceneid=‘63581299721637758596‘)
loop
for v_index in 1..8 loop
if v_oldId=‘1‘ then
v_oldId := c.sceneid;
end if;
c.sceneid:=‘zx‘|| v_index ;
insert into scene_base values c;
--dbms_output.put_line(‘scene:‘||c.sceneid);
for p in (select * from scene_pic where sceneid = v_oldId)
loop
p.sceneid := c.sceneid;
p.picid := ‘zx‘||v_index||p.picId;
insert into scene_pic values p;
--dbms_output.put_line(‘sceneId:‘||c.sceneid||‘ picId:‘||p.picid);
end loop;
end loop;
end loop;
end;
oracle操作。
标签:
本文系统来源:http://www.cnblogs.com/wrnsweet/p/5578278.html
内容总结
以上是互联网集市为您收集整理的oracle操作。全部内容,希望文章能够帮你解决oracle操作。所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。