oracle存储过程调用另一个存储过程
createorreplacefunctiondltrans.fcUpdateWorkLayerFields(sBizIDinVarchar2)returninteger...
create or replace function dltrans.fcUpdateWorkLayerFields( sBizID in Varchar2) return integer is
参 数: sBizID 业务标识
Begin
Begin
-- 查询工作图记录是否存在
If sBizID = '1' Then
sPhyLayerFullName := 'DLGIS.GZT_STGDTC';
ElsIf sBizID = '2' Then
sPhyLayerFullName := 'DLGIS.GZT_JSYDBP';
--sPhyLayerFullName := 'DLGIS.shyt测试图层';
Elsif sBizId='3' then
dltrans.gtzybtdzztc;--在这调用
end if;
end fcUpdateWorkLayerFields;
这是一个存储过程,调用下面的存储过程
create or replace function dltrans.GTZYBTDZZTC( sGuidValue in Varchar2,
sGuidFiledName in Varchar2, sDKBH in Varchar2)
return integer is
--自定义
sSQL3 VARCHAR2(200);
sxmbh varchar2(200);
sxmmc varchar2(1000);
syswh varchar2(200);
sysdw varchar2(200);
sysrq varchar2(30);
sxmszdsheng varchar2(200);
sxmszdshi varchar2(200);
sxmszdxian varchar2(200);
iCount Integer;
iResult INTEGER;
tmprc pkdual.anycursor;
sPhyLayerFullName Varchar2(255);
begin
begin
iResult := -1;
sPhyLayerFullName := 'dlgis.GZT_GTZYBTDZZTC';
-- 查询是否存在记录
iCount := 0;
If sPhyLayerFullName is not null Then
sSQL3 := 'Select count(*) From ' || sPhyLayerFullName ||' Where xmbh = ' || sGuidValue ||' ';
Execute Immediate sSQL3
Into iCount;
End If;
If iCount < 1 Then
Return(iResult);
End If;
-- 查询表单是否存在记录(dltrans.TO_T_HBGY_KZ c,a.gd_guid=c.gd_guid And)
sSQL3 := 'Select count(*) From dltrans.to_t_tdzz a,dltrans.to_T_tdzz_DK d Where a.xmbh=d.xmbh and a.xmbh= ''' || sGuidValue || ''' ';
Execute Immediate sSQL3
Into iCount;
If iCount < 1 Then
Return(iResult);
end if;
-- 获取表单数据
open tmprc for
Select
nvl(a.xmmc,''),
nvl(a.xmszdsheng,''),
nvl(a.xmszdshi,''),
nvl(a.xmszdxian,''),
nvl(a.ysdw,''),
nvl(a.yswh,''),
nvl(a.ysrq,'')
From dltrans.to_t_tdzz a,
dltrans.to_T_TDZZ_DK d
Where a.xmbh = d.xmbh
and a.xmbh = sGuidValue;
loop
fetch tmprc
Into sxmmc ,
syswh ,
sysdw ,
sysrq ,
sxmszdsheng,
sxmszdshi ,
sxmszdxian ;
exit when tmprc%notfound;
-- 自定义字段对照更新
Update DLGIS.GZT_GTZYBTDZZTC
Set xmmc = sxmmc,
yswh = syswh,
ysdw = sysdw,
ysrq = sysrq,
xmszs = sxmszdsheng,
xmszs_1 = sxmszdshi ,
xmszx = sxmszdxian
Where xmbh = sGuidValue;
Execute Immediate sSQL3 ;
end loop;
close tmprc;
Commit;
return 1;
EXCEPTION
WHEN OTHERS THEN
Rollback;
iResult := -1;
end;
return(iResult);
end;
帮我看以下 这个存储过程是有问题的,总是报错,帮我改一下,谢谢哥哥姐姐们,具体该怎么写,帮我改下,就是 展开
参 数: sBizID 业务标识
Begin
Begin
-- 查询工作图记录是否存在
If sBizID = '1' Then
sPhyLayerFullName := 'DLGIS.GZT_STGDTC';
ElsIf sBizID = '2' Then
sPhyLayerFullName := 'DLGIS.GZT_JSYDBP';
--sPhyLayerFullName := 'DLGIS.shyt测试图层';
Elsif sBizId='3' then
dltrans.gtzybtdzztc;--在这调用
end if;
end fcUpdateWorkLayerFields;
这是一个存储过程,调用下面的存储过程
create or replace function dltrans.GTZYBTDZZTC( sGuidValue in Varchar2,
sGuidFiledName in Varchar2, sDKBH in Varchar2)
return integer is
--自定义
sSQL3 VARCHAR2(200);
sxmbh varchar2(200);
sxmmc varchar2(1000);
syswh varchar2(200);
sysdw varchar2(200);
sysrq varchar2(30);
sxmszdsheng varchar2(200);
sxmszdshi varchar2(200);
sxmszdxian varchar2(200);
iCount Integer;
iResult INTEGER;
tmprc pkdual.anycursor;
sPhyLayerFullName Varchar2(255);
begin
begin
iResult := -1;
sPhyLayerFullName := 'dlgis.GZT_GTZYBTDZZTC';
-- 查询是否存在记录
iCount := 0;
If sPhyLayerFullName is not null Then
sSQL3 := 'Select count(*) From ' || sPhyLayerFullName ||' Where xmbh = ' || sGuidValue ||' ';
Execute Immediate sSQL3
Into iCount;
End If;
If iCount < 1 Then
Return(iResult);
End If;
-- 查询表单是否存在记录(dltrans.TO_T_HBGY_KZ c,a.gd_guid=c.gd_guid And)
sSQL3 := 'Select count(*) From dltrans.to_t_tdzz a,dltrans.to_T_tdzz_DK d Where a.xmbh=d.xmbh and a.xmbh= ''' || sGuidValue || ''' ';
Execute Immediate sSQL3
Into iCount;
If iCount < 1 Then
Return(iResult);
end if;
-- 获取表单数据
open tmprc for
Select
nvl(a.xmmc,''),
nvl(a.xmszdsheng,''),
nvl(a.xmszdshi,''),
nvl(a.xmszdxian,''),
nvl(a.ysdw,''),
nvl(a.yswh,''),
nvl(a.ysrq,'')
From dltrans.to_t_tdzz a,
dltrans.to_T_TDZZ_DK d
Where a.xmbh = d.xmbh
and a.xmbh = sGuidValue;
loop
fetch tmprc
Into sxmmc ,
syswh ,
sysdw ,
sysrq ,
sxmszdsheng,
sxmszdshi ,
sxmszdxian ;
exit when tmprc%notfound;
-- 自定义字段对照更新
Update DLGIS.GZT_GTZYBTDZZTC
Set xmmc = sxmmc,
yswh = syswh,
ysdw = sysdw,
ysrq = sysrq,
xmszs = sxmszdsheng,
xmszs_1 = sxmszdshi ,
xmszx = sxmszdxian
Where xmbh = sGuidValue;
Execute Immediate sSQL3 ;
end loop;
close tmprc;
Commit;
return 1;
EXCEPTION
WHEN OTHERS THEN
Rollback;
iResult := -1;
end;
return(iResult);
end;
帮我看以下 这个存储过程是有问题的,总是报错,帮我改一下,谢谢哥哥姐姐们,具体该怎么写,帮我改下,就是 展开
2个回答
今至电子科技有限公司
2024-08-23 广告
2024-08-23 广告
数据库备份是确保数据安全与业务连续性的关键环节。我们上海今至电子科技有限公司高度重视数据保护,定期执行全面的数据库备份策略。这包括使用先进工具和技术,对关键业务数据进行自动化备份,并存储在安全可靠的外部存储介质或云端。通过定期验证备份的完整...
点击进入详情页
本回答由今至电子科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |