oracle中两个游标同时打开运行,两个游标值是一一对应?请问咋写?
cursorcur_ec_purproject_reqisselect'产品编码:'||r.pk_prod||''||'本次采购数量:'||r.pur_num||CHR(...
cursor cur_ec_purproject_req is
select '产品编码:'||r.pk_prod||' '||'本次采购数量:'||r.pur_num ||CHR(10)||'需求说明:'||r.product_state||CHR(10)
from ec_purproject_req r
where r.pk_pur_project = :new_value.pk_pur_project
and r.dr=0;
cursor cur_pk_material is
select '产品名称:'||m.name||' '||'规格:'||m.materialspec||' '
from bd_material m
where m.pk_material in (select pk_prod_v from ec_purproject_req where pk_pur_project = :new_value.pk_pur_project and dr=0)
and m.dr=0;
这两个游标的值让他们一一对应,应该怎么做? 展开
select '产品编码:'||r.pk_prod||' '||'本次采购数量:'||r.pur_num ||CHR(10)||'需求说明:'||r.product_state||CHR(10)
from ec_purproject_req r
where r.pk_pur_project = :new_value.pk_pur_project
and r.dr=0;
cursor cur_pk_material is
select '产品名称:'||m.name||' '||'规格:'||m.materialspec||' '
from bd_material m
where m.pk_material in (select pk_prod_v from ec_purproject_req where pk_pur_project = :new_value.pk_pur_project and dr=0)
and m.dr=0;
这两个游标的值让他们一一对应,应该怎么做? 展开
1个回答
展开全部
-- 一对一,没法对起来,但是你可以把这两个游标合并成一个,那就肯定是一一对应的。
cursor cur_ec_bd is
select '产品编码:'||r.pk_prod||' '||'本次采购数量:'||r.pur_num ||CHR(10)||'需求说明:'||r.product_state||CHR(10) as rec,
'产品名称:'||m.name||' '||'规格:'||m.materialspec||' ' as mbd
from ec_purproject_req r,bd_material m
where r.pk_pur_project = :new_value.pk_pur_project and r.dr=0 and m.pk_material=r.pk_prod_v and m.dr=0;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询