Hi,

Actually, when storing an empty string, '', to a varchar, sybase stores it as a space. Some apps provide a setting to strip trailing spaces.


terry

Rainer J. H. Brandt wrote:

Hi,

I have stored en empty string in a varchar(255) column of a Sybase ASE.
When I retrieve it via

 $r = $dbh->selectall_arrayref("select Value from Example where Id = 17");

then the following is true:

 $r->[0]->[0] eq ' '

I expected it to be false and instead

 $r->[0]->[0] eq ''

(with an empty string) to be true.

In my opinion, that is a bug.
Notice:  The Database really has an empty string, not a NULL value or any
other weird thing.

I saw your explanation of syb_bind_empty_string_as_null, but that seems
to be related to something different.

Do you think I am misunderstanding something or do you agree that it
is a bug?

I am using Solaris 10/SPARC, Perl 5.8.6, DBI 1.48, DBD::Sybase 1.05.
ASE is 12.5.

The same happens with Solaris 8, Perl 5.6.1, DBI 1.32, DBD::Sybase 0.95,
ASE 12.0.


Something completely different: You write about "make test" failing under Solaris when LD_LIBRARY_PATH is set. Your note isn't quite accurate; the same happens if LD_LIBRARY_PATH isn't set. (Actually, one should avoid LD_LIBRARY_PATH whenever possible.) There are two possibilities besides adjusting the LD_LIBRARY_PATH value to contain the Sybase library path:

1. set LD_RUN_PATH to contain the Sybase library path before running
  "make test"

2. when building the module, use -R <Sybase library path> in addition
to -L <Sybase library path>. If that's done, the shared library
will know where to resolve its dependencies.
For instance:


ldd /backup/rjhb/w/DBD-Sybase-1.05/blib/arch/auto/DBD/Sybase/Sybase.so


       libct.so =>      /opt/sybase/V12.5/OCS-12_5/lib/libct.so
       libcs.so =>      /opt/sybase/V12.5/OCS-12_5/lib/libcs.so
       libtcl.so =>     /opt/sybase/V12.5/OCS-12_5/lib/libtcl.so
       libcomn.so =>    /opt/sybase/V12.5/OCS-12_5/lib/libcomn.so
       libintl.so =>    /opt/sybase/V12.5/OCS-12_5/lib/libintl.so
       libdl.so.1 =>    /lib/libdl.so.1
       libm.so.2 =>     /lib/libm.so.2
       libc.so.1 =>     /lib/libc.so.1
       libsocket.so.1 =>        /lib/libsocket.so.1
       libnsl.so.1 =>   /lib/libnsl.so.1
       libmp.so.2 =>    /lib/libmp.so.2
       libmd5.so.1 =>   /lib/libmd5.so.1
       libscf.so.1 =>   /lib/libscf.so.1
       libdoor.so.1 =>  /lib/libdoor.so.1
       libuutil.so.1 =>         /lib/libuutil.so.1
       /platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
       /platform/SUNW,Sun-Blade-100/lib/libmd5_psr.so.1


"-R" is an option of Sun's linker (also used when building with gcc) and the preferred way to get rid of LD_LIBRARY_PATH trouble.

Could you please tell me your opinion about the empty string problem?
Thanks,
Rainer
----------------------------------------------------------------------
Rainer J. H. Brandt                            email:     [EMAIL PROTECTED]
Brandt & Brandt Computer GmbH                  web:        www.bb-c.de
Kamberg 111                                    phone:  +49 2448 919126
D 53940 Hellenthal                             mobile: +49 172 9593205





Reply via email to