August 8, 2017 at 8:00 am
Hello,
Can a bit be used when validating for a return code? Or should int be used? Why or why not?
August 8, 2017 at 8:08 am
rjjh78 - Tuesday, August 8, 2017 8:00 AMHello,
Can a bit be used when validating for a return code? Or should int be used? Why or why not?
It should be an int. Because it can be more than 0,1 null. Per the documentation, the expected type is int
Return
Returning Data by Using A Return Code
Sue
August 8, 2017 at 8:14 am
Thank you kindly!
August 8, 2017 at 8:33 am
You can return a bit value, but it will be implicitly converted into an int.
If you capture the result value with a bit, you only have 3 available values 0, 1, NULL.
August 10, 2017 at 7:22 pm
This was removed by the editor as SPAM
August 11, 2017 at 6:59 am
vincentshanecurtis - Thursday, August 10, 2017 7:22 PMSince a bit only has two values 1 or 0, yes or no, on or off. Bits should only be used when your return code would reflect only those two possibilities. If you are expecting to return an actual number and not a logical yes or no value then you should use an int.
A bit has THREE possible values: 1, 0, or NULL.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply