Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Jas

Senior Veteran
Registered:
Posts: 429
Reply with quote  #1 
Hey guys

I'm trying to execute a stored proc that takes three parameters -

@TVP, @FolderId, @UserId

I've created the TVP table type definition and tested this through management studio okay.

In BPM I'm creating a DataTable serverside and when I try and pass this and the other parameters through Mstm.Select to the stored proc I get an "unknown parameter name @FolderId?" error.

0
Jas

Senior Veteran
Registered:
Posts: 429
Reply with quote  #2 
I tried running a trace and doesnt look like i'm getting as far as calling the stored proc so error is coming from bpm.
0
JoeOmerta

Veteran
Registered:
Posts: 210
Reply with quote  #3 
Can you post your code or the portion in question?
0
Jas

Senior Veteran
Registered:
Posts: 429
Reply with quote  #4 
Looks like I posted the wrong parameter name earlier.

So I have a stored proc mySP which takes three parameters -
@BulkData myTableType,
@FolderId VARCHAR(31),
@UserName VARCHAR(50)


myTableType is a user defined table type which basically provides the table structure for the @BulkData table valued parameter.


In BPM I create myDataTable and populate it and then try and pass it to SQL Server for further operations -

QueryParameter[] parameters = new QueryParameter[]
{
 new QueryParameter("@BulkInvData myTableType", myDataTable),
 new QueryParameter("@FolderID", sFolderId),
 new QueryParameter("@UserName", sUser)
};   
     

Mstm.SelectSql(null, "EXEC mySP @BulkInvData myTableType, @FolderID, @UserName", parameters);

I get error unknown parameter name @BulkInvData. 


If I omit the the table type from the parameter name i.e. do 

QueryParameter[] parameters = new QueryParameter[]
{
 new QueryParameter("@BulkInvData", myDataTable),
 new QueryParameter("@FolderID", sFolderId),
 new QueryParameter("@UserName", sUser)
};   

Mstm.SelectSql(null, "EXEC mySP @BulkInvData, @FolderID, @UserName", parameters);

Then I get error - The table type parameter @BulkInvData must have a valid type name
0
JoeOmerta

Veteran
Registered:
Posts: 210
Reply with quote  #5 
You should be able to just to

Mstm.SelectSql(null, "EXEC mySP '" + myDataTable, sFolderId, sUser + "'")
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!