set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[usp_SYSFORM100_GetApproverList]
@STRFORMKIND NVARCHAR(30),
@INTFORMNO INT
AS
--
--DECLARE @STRFORMKIND NVARCHAR(30)
--DECLARE @INTFORMNO INT
--SET @STRFORMKIND='SYS.FORM.100'
--SET @INTFORMNO=96
DECLARE @CHANGE_ID VARCHAR(50)
DECLARE @SESSION_ID VARCHAR(50)
DECLARE @ORACLE_SQL VARCHAR(500)
SET @SESSION_ID=NEWID()
SELECT @CHANGE_ID = CHANGE_ID FROM SYSFORM100 WHERE FORM_NO = @INTFORMNO
--生成审批数据
EXEC('BEGIN BPM_DCS_PKG.GET_APPROVE_LIST(?,?);END;',@CHANGE_ID,@SESSION_ID) AT ORACLE_ERP
--获取审批数据
SET @ORACLE_SQL='SELECT APPROVER_ID, SEQUENCE_NO, APPROVER_ROLE FROM BPM_DCS_APPROVE_LIST WHERE CHANGE_ID=? AND SESSION_ID=? ORDER BY SEQUENCE_NO'
EXEC(@ORACLE_SQL,@CHANGE_ID,@SESSION_ID) AT ORACLE_ERP
--删除ERP中生成的数据
EXEC('DELETE BPM_DCS_APPROVE_LIST WHERE CHANGE_ID =?',@CHANGE_ID) AT ORACLE_ERP