FW: :ODBC {ChopBlanks=>1} option issue

"Manikantan, Madhunapanthula_Naaga" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel,gmane.comp.lang.perl.modules.dbi.general
Message-ID <1485868F0AD5AC4EB1A9047C9D6FFCE03B67E987@MAILHYDMB1A.winmail.deshaw.com>
Forwarding to DBI-dev , DBI-users as an fyi.
Thanks

_____________________________________________
From: Manikantan, Madhunapanthula_Naaga
Sent: Friday, June 01, 2012 5:02 PM
To: 'Martin J. Evans'
Subject: DBD::ODBC {ChopBlanks=>1} option issue


Hello Martin,

I hope you are doing well.

ChopBlanks option, doesn't seem to work with DBD::ODBC.  Can you please help?

I checked out latest version of DBD::ODBC from svn.perl.org and tested the below script on solaris and Linux.

Please let me know if you need further information.

O/p from my test
----
[email protected]:~/Driver$<mailto:[email protected]:~/Driver$> perl  -I blib/lib/ -I blib/arch/  ~/chopblanks.pl
$VAR1 = [
          [
            ' ' # has once space
          ]
        ];

SQL
---
# Create table
create table test (v varchar(128))
# set permissions
grant all on public to test
# populate data
insert into test values('  ') -- one space


Environment:-
-----------
OS   :- Red Hat Enterprise Linux 6
Perl :- 5.10.1
DBI  :- 1.609


Test Script
-------------
use DBI;
use Data::Dumper;
$dbh = DBI->connect('dbi:ODBC:DSN=DBTEST-es','****','***',{ChopBlanks => 1});
#$dbh->{TraceLevel}=15;
$sth = $dbh->prepare('select v from sandbox.dbo.test');
$sth->execute();
$rows = $sth->fetchall_arrayref();
print Dumper($rows);


Regards,
Mani.


Ps:
FTR, I read the below extract from DBD::ODBC documentation

---
I am at present unsure if ChopBlanks processing on Unicode strings is working correctly on UNIX. If nothing else the construct L' ' in dbdimp.c might not work with all UNIX compilers. Reports of issues and patches welcome.
---
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.