January 23, 2006 at 9:46 pm
Hi,
Below is a simple SP created to stimulate my issue.
If I run the SP, it is working correctly.
However, when I debug it in QA, it will print 'Length >0' when I pass '' as input parameters. Why is QA having such a issue which confused me.
Anyone got any ideal why QA is having this issue. I am using SQL2k
with SP4
create procedure dbo.a_123
(
@i_name varchar(50)
)
as begin
if(len(@i_name)>0)
print 'Length > 0'
else
print 'Length = 0'
end
GO
January 24, 2006 at 12:18 am
Hmmm ... works fine for me.
Are you sure you're passing in the correct input?
Put a print statement to show the @i_name variable before the If .
--------------------
Colt 45 - the original point and click interface
January 24, 2006 at 1:12 am
If you pass in a string containing nothing but spaces LEN will return 0.
January 24, 2006 at 6:45 am
Yes, so by that logic it should print 'Length = 0' ( which it does for me )
Vladmir's problem is that it's printing 'Length > 0'
--------------------
Colt 45 - the original point and click interface
January 24, 2006 at 11:24 am
If it is doing it during DEBUG I would suggest printing the LEN and the CODE() for the character that is being passed in.
Clearly DEBUG is translating the space in some way but as to why I don't know. It is something odd on Vladmir's server.
January 25, 2006 at 1:00 am
Hi,
Thank everyone, someone point out that my problem and QA limitation.
One of my debugging tool, show that some of my input parameter is '',
so I enter '' for that parameter in the debugging mode, it will show
len(@i_name) > 0.
Instead, I should be enter space in the debugging mode for that parameter
or change that parameter in debugging mode.
HTH
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply