oracle 存储过程 循环嵌套
--Createdon2010-11-4-星期四byADMINISTRATORdeclare--LocalvariableshereEXPR_IDCHAR(10);KMB...
-- Created on 2010-11-4-星期四 by ADMINISTRATOR
declare
-- Local variables here
EXPR_ID CHAR(10);
KMB_ID CHAR(10);
EXPR_VALUE CHAR(100);
KMB_VALUE CHAR(100);
EXPR_VALUE_TMP NUMBER(16,2);
cursor cursor1 is select zbh,zbgs from a_zbgsb;
begin
for expr1 in cursor1 loop
EXPR_ID:=expr1.zbh;
EXPR_VALUE:=expr1.zbgs;
cursor cursor2 is select kmh,kmye from a_kmyeb;
begin
for expr2 in cursor2 loop
KMB_ID:=expr2.kmh;
KMB_VALUE:=expr2.kmye;
EXPR_VALUE_TMP:= REPLACE( EXPR_VALUE, RTRIM(KMB_ID), RTRIM(KMB_VALUE) );
insert into a_zbyeb values (EXPR_ID,EXPR_VALUE_TMP) ;
end loop;
end;
end loop;
end;
各位大哥,小弟是刚刚解除oracle存储过程,想问问我这么个写法语法上有问题吗?运行的时候总是报在 cursor2这个地方有错!求各位大哥帮帮忙! 展开
declare
-- Local variables here
EXPR_ID CHAR(10);
KMB_ID CHAR(10);
EXPR_VALUE CHAR(100);
KMB_VALUE CHAR(100);
EXPR_VALUE_TMP NUMBER(16,2);
cursor cursor1 is select zbh,zbgs from a_zbgsb;
begin
for expr1 in cursor1 loop
EXPR_ID:=expr1.zbh;
EXPR_VALUE:=expr1.zbgs;
cursor cursor2 is select kmh,kmye from a_kmyeb;
begin
for expr2 in cursor2 loop
KMB_ID:=expr2.kmh;
KMB_VALUE:=expr2.kmye;
EXPR_VALUE_TMP:= REPLACE( EXPR_VALUE, RTRIM(KMB_ID), RTRIM(KMB_VALUE) );
insert into a_zbyeb values (EXPR_ID,EXPR_VALUE_TMP) ;
end loop;
end;
end loop;
end;
各位大哥,小弟是刚刚解除oracle存储过程,想问问我这么个写法语法上有问题吗?运行的时候总是报在 cursor2这个地方有错!求各位大哥帮帮忙! 展开
2个回答
展开全部
cursor cursor2 is select kmh,kmye from a_kmyeb;
你这是定义变拆销慧量斗陆。
请放在
cursor cursor1 is select zbh,zbgs from a_zbgsb;
后旅答
你这是定义变拆销慧量斗陆。
请放在
cursor cursor1 is select zbh,zbgs from a_zbgsb;
后旅答
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询