Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

We've discovered a phenomenon when char() variable gets truncated to NULL as it is passed from proc to proc.


This has not been the case in old version and it causes some of our code to break.


I do not recall any mention of this type of change to default behaviour around spaces in ASE 16.


Is this something you encountered too? Is there a config parameter to change this behaviour back to what has been common in ASE 15?

Easy repro:


ASE15:

1> create proc sp_space1 @c1 char(3) = null, @vc1 varchar(3) = null as select char_length(@c1) as c1, char_length(@vc1) as vc1

2> go


1> sp_space1 " ", " "

2> go


c1 vc1

------

3 2
(1 row affected)

(return status = 0)

1> create proc sp_space2 @c1 char(3) = null, @vc1 varchar(3) = null as exec sp_space1 @c1 = @c1 , @vc1 = @vc1

2> go

1> sp_space1 " ", " "

2> go


c1 vc1

--- ---

3 2

(1 row affected)

(return status = 0)

1> sp_space2 " ", " "

2> go


c1 vc1

--- ---

3 2
(1 row affected)

(return status = 0)

1> select @@version

2> go

------------------------------------------------------------------------------------------------------------------------------

Adaptive Server Enterprise/15.0.3/EBF 18467 ESD#4 ONE-OFF/P/Sun_svr4/OS 5.8/ase1503/2768/64-bit/FBO/Thu Nov 18 20:03:17 2010

ASE16:

1> create proc sp_space1 @c1 char(3) = null, @vc1 varchar(3) = null as select char_length(@c1) as c1, char_length(@vc1) as vc1

2> go

1> sp_space1 " ", " "

2> go


c1 vc1

---------- -----------

3 2

(1 row affected)

(return status = 0)

1> create proc sp_space2 @c1 char(3) = null, @vc1 varchar(3) = null as exec sp_space1 @c1 = @c1 , @vc1 = @vc1

2> go

1> sp_space1 " ", " "

2> go

c1 vc1

--- ---

3 2
(1 row affected)

(return status = 0)

1> sp_space2 " ", " "

2> go


c1 vc1

--- ---

NULL 2

(1 row affected)

(return status = 0)

1> select @@version

2> go

-----------------------------------------------------------------------------------------------------------------------------------------------
Adaptive Server Enterprise/16.0 SP01 PL02/EBF 24486 SMP/P/Sun_svr4/OS 5.10/ase160bw/3722/64-bit/FBO/Fri Jun 5 07:50:19 2015



5 Comments
Labels in this area