注册

达梦带游标变量的存储过程在线上如何调试?请教社区各位老师,在此非常感谢!

阿杰升级路 2024/04/10 465 1

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:DM8
【操作系统】:WIN10
【CPU】:
【问题描述】*:我有一个存储过程,返回了3个list;

1、在项目上线后,我应该如何调试,让这三个查询语句把数据显示出来?有没有像sqlserver 的sql server Profiler 工具来跟踪?
2、如果手写代码块,应该如何写才能显示出list呢?
3、存储过程如下:
CREATE OR REPLACE PROCEDURE 
SelNongJJDTransDatas(
$strSpreadCertNum IN VARCHAR(50),
$strManufacturerNames IN VARCHAR(100),
$strtModel IN VARCHAR(100) :='',
$intAreaCode IN INT,
$nstrMsg OUT VARCHAR2(32767) DEFAULT '',
$spreadCertMsg OUT CURSOR,
$jsggList OUT CURSOR,
$lessenJsggList OUT CURSOR
)
AS    
  _strPMName  varchar(200);
  _strAPPLICANT varchar(200);
  _strPMCode varchar(15);
  _strsplit varchar2;
  _strwhere varchar(500) DEFAULT '';    

BEGIN      
	 open $spreadCertMsg FOR  
	 select top 1 GId,Authenticate,AuthenticateUrl,Authenticate_Num,      
	 CertificateUrl,Certificate_Num,ns.id,_strPMName as Product_Item,
	 case when  $strtModel='' then (Product_Model+case when isnull(COVERTYPE,'') in ('','无','/','\') then '' else '、'+ 
	 replace(replace(replace(replace(replace(isnull(COVERTYPE,''),',','、'),';','、'),'、','、'),',','、'),';','、') end) else ISNULL($strtModel,'') end as Product_Model,
	 case substring(CERTIFICATE_NUM,1,3) when 'Z20' then Product_Name+'(专定)' else Product_Name end as Product_Name,
	 Product_Smart,Product_Type,Start_Date,Valid_Date,BGBG=isnull(BGBG,''),RESULT_CONTENT=isnull(RESULT_CONTENT,'')
	 ,case substring(Authenticate,1,1) when '部' then '总站' else Authenticate end as IssuingOrg,GS_Content
	 from TD_NONGJJD_DATAS ns     
	 where isnull(status,'')='有效' and CERTIFICATE_NUM=$strSpreadCertNum and RTRIM(LTRIM(replace(replace(APPLICANT,char(10),' '),char(13),' ')))=$strManufacturerNames 
	 order by INSERT_DATE desc;
     
	OPEN $jsggList for 
	'select ProjectItem,Unit,DesignVal from TD_NONGJJD_JSGG jsgg,TD_NONGJJD_DATAS ns
	 where ns.CERTIFICATE_NUM=jsgg.CERTIFICATE_NUM  and 
	 isnull(ns.status,'''')=''有效'' and ns.CERTIFICATE_NUM='''+$strSpreadCertNum+''' and  RTRIM(LTRIM(replace(replace(APPLICANT,char(10),'' ''),char(13),'' '')))='''+$strManufacturerNames+''' ' + _strwhere+' 
	 order by jsgg.zid';
 
	 OPEN $lessenJsggList for 
	 'select ProjectItem,Unit,DesignVal from TD_NONGJJD_JSGG_LESSEN jsgg
	 inner join TD_NONGJJD_DATAS ns on ns.CERTIFICATE_NUM=jsgg.CERTIFICATE_NUM 
	 where ns.CERTIFICATE_NUM='''+$strSpreadCertNum+''' '+_strwhere+' order by jsgg.zid';
 end if;
           
EXCEPTION
when others then         
  set $nstrMsg='异常!' ;   
END;
回答 0
暂无回答
扫一扫
联系客服