Home Page › Forums › BizTalk 2004 – BizTalk 2010 › passing sql stored proc param type of bit
- This topic has 3 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
July 9, 2014 at 7:14 PM #26395
Hello,
I have a stored proc that I’m calling with input params that I need to populate. One of the params is type of bit. In my map I’m trying to pass a true as I’ve done in c# many times. But I keep getting the error “The string ‘true’ is not a valid AllXsd value”. I tried using an inline c# scripting functoid but it didn’t help.
the inline c# is like this:
public Boolean convertToBool(string param1)
{
if (param1.Equals(“true”)) return true;
return false;
}
(Can I even have the script return Boolean or does it have to return a string?)
I also tried to change the param type to an int and use an integer functoid just using 1 as my input. that gave me this error: “Input string was not in a correct format”
I don’t care if I have a bit or an int as the type. But how do I do this?
I might add that I’m fairly new to BizTalk 🙂
Thank you.
-
July 10, 2014 at 4:02 AM #26397
You can set the datatype to xs:boolean for the element in the Schema.
And code as below:
public bool convertToBool(string param1)
{
if (param1.Equals("true")) return true;
return false;
}
-
July 10, 2014 at 11:05 AM #26403
Thank you. The type of the schema is and was xs:boolean. The diff between your code and mine is that I was returning Boolean and you're returning bool. I changed the script to yours and the error message is different but still not working. Error: 'Inner exception: Input string was not in a correct format.' In the stack trace it is trying to do a StringToNumber and I don't understand why. My message is this:
<ns0:uspUpdateBizTalkrunDates xmlns:ns0="schemas.microsoft.com/…/dbo">
<ns0:ProcessName>orchPractitionerSpecialties</ns0:ProcessName>
<ns0:RunToDate>2014-07-10T08:34:20</ns0:RunToDate>
<ns0:Successful>true</ns0:Successful>
</ns0:uspUpdateBizTalkrunDates>
types in the stored proc and schema respectively are:
ProcessName – VarChar(100) – xs:string
RunToDate – datetime – xs:dateTime
Successful – bit – xs:boolean
It is the send Shape that is throwing the error. any other suggestions? Thank you for your help!
-
July 10, 2014 at 11:20 AM #26404
I strongly believe that the Stored Procedure is failing because of the datetime format issue for the RunToDate field.
Just check the format of the Datetime column.
Try to call the Stored procedure with the same parameters from SQL mgmt Studio. Once you get the right format….use a script functoid to convert your datetime to correct format and map it to the RunToDate element.
The map seems to be working fine…as you do get the XML for the mapped Stored Procedure.
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.