首页 > Linux操作系统 > Linux操作系统 > query issue
begin
declare
cursor c1 is
SELECT WIP_ENTITY_NAME,MSI.SEGMENT1,WRO.required_quantity
FROM
WIP.WIP_ENTITIES WE,
apps.wip_requirement_operations WRO,
apps.mtl_system_items msi
WHERE
we.wip_entity_id =WRO.WIP_ENTITY_ID
AND WRO.inventory_item_id=MSI.inventory_item_id
and msi.organization_id=299
and msi.organization_id=we.organization_id
and msi.organization_id=wro.organization_id
and we.wip_entity_name=:crtorl.text_item117;
v1 c1%rowtype;
begin
open c1;
loop
fetch c1 into v1;
exit when c1%notfound;
insert into wip_temp (NAME,WIP_COMP_NAME ,WIP_QTY )
values (v1.wip_entity_name,v1.segment1,v1.required_quantity);
:system.message_level:=20;
commit;
--:system.message_level:=0;
end loop;
close c1;
exception
when others then
null;
end;
GO_BLOCK('wip_temp');
--SET_BLOCK_PROPERTY('wip_temp',DEFAULT_WHERE,'where name='||':wip_name.NAME');
SET_BLOCK_PROPERTY('wip_temp', default_where,'name=:crtorl.text_item117');
EXECUTE_QUERY;
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12122734/viewspace-501590/,如需转载,请注明出处,否则将追究法律责任。