Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
JoeOmerta

Veteran
Registered:
Posts: 210
Reply with quote  #1 
Do you call them from client-scripts, server-scripts, code-activities?

If you're trying to return a value using "OUTPUT", how is that accomplished?

Here is the Stored Procedure...
Quote:
ALTER proc [dbo].[CheckRequest]
@REQ_EMPL_CODE varchar(6) ,
@CLIENT_CODE varchar(10)=NULL ,
@VENDOR_ID varchar(10)=NULL,
@TEXT_REF varchar(max) ,
@CHECK_DATE datetime ,
@CHK_AMT money ,
@INVOICE_NUM varchar(20)=NULL,
@REQUEST_NUM int OUTPUT,
@RESULT_TEXT varchar(max)=NULL OUTPUT
as
begin
select @REQUEST_NUM = max(request_num) from apcheck


Here's how i'm currently calling it but it's giving me "unknown parameter name @REQUEST_NUM"
Quote:
Metastorm.Runtime.Core.QueryParameter[] CRPParams = new Metastorm.Runtime.Core.QueryParameter[7];
CRPParams[0] = Mstm.SQLArg("@REQ_EMPL_CODE", CheckRequestProcessData.txtAttyCode);
CRPParams[1] = Mstm.SQLArg("@CLIENT_CODE", CheckRequestProcessData.txtClientCode);
CRPParams[2] = Mstm.SQLArg("@VENDOR_ID", CheckRequestProcessData.txtVendorID);
CRPParams[3] = Mstm.SQLArg("@TEXT_REF", CheckRequestProcessData.txtDescription);
CRPParams[4] = Mstm.SQLArg("@CHECK_DATE", CheckRequestProcessData.dtmRequested);
CRPParams[5] = Mstm.SQLArg("@CHK_AMT", CheckRequestProcessData.curAmount);
CRPParams[6] = Mstm.SQLArg("@INVOICE_NUM", CheckRequestProcessData.txtInvoiceNumber);
//CRPParams[7] = Mstm.SQLArg("@REQUEST_NUM", SqlDbType.Int);

string cmd = "EXEC dbo.CheckRequest " +
    "@REQ_EMPL_CODE, @CLIENT_CODE, @VENDOR_ID, @TEXT_REF, @CHECK_DATE, @CHK_AMT, @INVOICE_NUM, @REQUEST_NUM OUTPUT; SELECT @REQUEST_NUM";
   
CheckRequestProcessData.intRequestNum = SelectSql(new Aderant(), cmd, CRPParams).Integer;


Currently i'm calling it from a Code Activity on a "When action completed".  If i uncomment CRPParams[7] it will return an 8 when it's supposed to return 550023.  Any ideas?
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
As I understand it from other posts, output variables are not supported.  However, if your stored procedure/function returns a value itself, it should work when using SelectSQL.

Others may have other ideas, but maybe create two "wrapper" functions/procedures which calls CheckRequest but then returns the particular output value desired?  (Not the best approach I admit but the first that came to mind.)
0
JoeOmerta

Veteran
Registered:
Posts: 210
Reply with quote  #3 
I figured it out.  I had to remove @REQUEST_NUM from the metastorm code.  And move @REQUEST_NUM from proc to after "begin" in the sql code.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!