on 2024 May 13 9:54 AM
I have a stored procedure like this:
create procedure "dba"."xxx"( in @param1 integer,in @param2 integer,in @param3 varchar(4096) default '' ) begin if @param3 = '' then /* ... */ else /* ... */ end if end
Since a long time this worked well as expected. Actually a customer reported a problem and I noticed by testing the following call:
call dba.xxx(11,1)
@param3 comes with value '0'. I am really suprised. Under which circumstances is the default value not reliable?
Request clarification before answering.
Did you or your customer connect via TDS? If so, I believe '' is considered equivalent to NULL and comparing anything against NULL would be false (actually 'unknown')?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.