try:open cur_cp_cx;
fetch cur_cp_cx into v_tzid;
while cur_cp_cx %found loop
select max(cpjd_id) into v_cpjdid from CP_JBXX where tz_id=v_tzid;
select cp_isn,cp_nm into v_cpisn,v_cpnm from CP_JBXX where cpjd_id=v_cpjdid and tz_id=v_tzid;
insert into TP_CP_CX(cp_isn,tz_id,cp_nm,cpjd_id) values (v_cpisn,v_tzid,v_cpnm,v_cpjdid);
fetch cur_cp_cx into v_tzid;
end loop;
fetch cur_cp_cx into v_tzid;
while cur_cp_cx %found loop
select max(cpjd_id) into v_cpjdid from CP_JBXX where tz_id=v_tzid;
select cp_isn,cp_nm into v_cpisn,v_cpnm from CP_JBXX where cpjd_id=v_cpjdid and tz_id=v_tzid;
insert into TP_CP_CX(cp_isn,tz_id,cp_nm,cpjd_id) values (v_cpisn,v_tzid,v_cpnm,v_cpjdid);
fetch cur_cp_cx into v_tzid;
end loop;
解决方案 »
- powerbuilder 11.5 连接 ORACLE 10g的问题
- 求根据国标写的数据库设计说明书的实例文档!!
- 求教一个sql语句的问题
- 我在sqlplus里insert了一条数据,在sqlplus可以select看到,为什么在worksheet和里select看不到?
- PLSQL之簡單問題
- 请问:sqlserver中的EXECUTE在ORACLE中怎么用
- pl/sql或oracle中dblink用法
- 客户机对数据库数据进行的任何操作,如何在服务器上拦截并取得相应的SQL语句?
- 自已写的第一个oracle触发器,有错误请教各位
- 一道数据库选择题
- 用Oracle9i高级索引技术助力SQL
- varchar(size)会不会真的占用空间?
fetch cur_cp_cx into v_tzid;
while cur_cp_cx %found loop
...
...
fetch cur_cp_cx into v_tzid;
end loop;把循环这里改成这样就可以了。