Empty strings and setzerolengthstringstonull for Sybase

General discussion forum about all databases other than SqlBase.
FredRoge

Empty strings and setzerolengthstringstonull for Sybase

Post by FredRoge » 15 Oct 2014, 15:30

Hello,

I eventually open this topic, as the subject is an highest risk one for migration projects to TD 6.x against Sybase RDBMS.

Here's the plain migration issue (wich I think, justify this post as a bug report)

And too, this behaviour is in contradiction with the documentation :
in "Connecting SQLWindows Objects to Databases -> Nulls, empty strings, and spaces",
the table specifies that the empty string ('') value sent through a bind variable should give NULL in Sybase11 DB (ok, we use Sybase 15.0.3, but why should it change anything...)

Up to TD3.1 (don't know for 4.x and 5.x versions, but I, am sure for previous, even 16bit ones, as this issue - and its solution - occurred with SqlServer but *not* with Sybase)
1. DML requests passing string values through bind variables set to either '' or STRING_Null write NULL in the DB (which is in conformity with the documentation)

With TD6.x
2. DML requests passing string values through bind variables set STRING_Null write NULL in the DB (which is in conformity with the documentation)
3. DML requests passing string values through bind variables set to '' write SPACE in the DB (which is *not* in conformity with the documentation)

Of course, as is, having to explicitely set thousands and thousands variables to STRING_Null in existing programs would be no less than a showstopper...

I just tried the famous - but, alas, now for a long time undocumented even for SqlServer - setzerolengthstringstonull=1 in [win32client] section, just to see... and it worked ! Behavior 3. resumed to 1.

So, I would strongly recommend to take either actions :
- correct the Sybase SqlRouter as to behave like in TD3.1 and as described in the documentation,
or
- correct the documentation and offically reintroduce - and most importantly, maintain - the setzerolengthstringstonull feature.

In this last case, as far as I understood discussions in other threads, it appears that the effects of setzerolengthstringstonull (set to 1 or absent) differs from platform to platform.

Best regards,

Fred Rogé

Return to “General Discussion”

Who is online

Users browsing this forum: [Applebot], [Ccbot] and 0 guests