On Sat, 2 Jun 2012 17:57:06 +0000, "Manikantan, Madhunapanthula_Naaga"
<madhunapanthula.naaga.manikan...@deshaw.com> wrote:

> Hello DBI-Dev,
> 
> After getting inputs from Martin and reading DBI documentation it became 
> clear to me that 'ChopBlanks' attribute is designed to work for fixed length 
> character types.
> Can you please let me know if this feature can be extended to variable length 
> character types as well?

Not by design. See also. If a (new) attribute would be created, all
DBD's should implement/support it.

file://localhost/work/www/Talks/DBDc/null.html


> Thanks a lot!
> Manikantan.
> 
>       _____________________________________________
>       From: Manikantan, Madhunapanthula_Naaga
>       Sent: Friday, June 01, 2012 5:26 PM
>       To: dbi-dev@perl.org; dbi-us...@perl.org
>       Cc: martin.ev...@easysoft.com
>       Subject: FW: :ODBC {ChopBlanks=>1} option issue
> 
> 
>       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
>       ----
>       manik...@finop2.nyc:~/Driver$<mailto:manik...@finop2.nyc:~/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.
>       ---
> 
> 
> 


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.14   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Reply via email to