Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
jrusling

Member
Registered:
Posts: 13
Reply with quote  #1 
I have been wrestling this one for a couple of days now and thought someone here might be able to help.

I am trying to execute a stored procedure with a single parameter. I am able to pass through a number of variations without trouble but when I try to put through the FolderID or a number as long as the FolderID I get an error.

This is the execute command:



SelectSql(new MetastormDefault(),"EXEC SetHours @FolderID", SQLArg("@FolderID", "SOMENUMBER"))



When SOMENUMBER is 5 or 9000005 it works fine but when it is the Folder ID it fails. Any suggestions?

The error I get is just the browser pop-up "An error occurred in this process. Please report the problem to your administrator"

__________________
John Rusling
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
You should be passing in a text string, not a number. I suspect the number is too large for the implicit conversion, and just fails, To see that, try looking in the Designer log, but in any case passing in a string will fix the issue.
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
jrusling

Member
Registered:
Posts: 13
Reply with quote  #3 
yeah, I guess that's the weird part... I am passing it in as a string. You'll notice the double quote around the variable "SOMENUMBER". In the DB procedure I have cast the variable as varchar(31) and I am passing the folder number like this "'"+ProcessContext.FolderID+"'". That should take it as a string. But for some reason it seems like it still sees it as a number.
__________________
John Rusling
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #4 
well, what is the error in the Designer log,m and what does the stored proc do?
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
Arrg!

You do NOT want to put quotes around the folder id when setting up the parameter! That is passing in a string of "<folderId>"  which is 33 chars, hence it is failing.

When using these parameters, do not format them, or mess them about. They are now properly bound parameters at the database level (unlike the hassle we had in previous versions).

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
jrusling

Member
Registered:
Posts: 13
Reply with quote  #6 
well I tried this with the quotes and without the quotes and I could not make it work either way. Finally I changed the strategy a bit and went about it differently. No stored procedure needed now. In the future I suppose I will need to figure this our but for now I'm good. Thanks.
__________________
John Rusling
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #7 
Just use SelectSql() and parameters!
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!