develooper Front page | perl.dbi.dev | Postings from June 2012

DBI : Extend 'ChopBlanks' support to variable length charactertypes

Thread Next
From:
Manikantan, Madhunapanthula_Naaga
Date:
June 2, 2012 10:57
Subject:
DBI : Extend 'ChopBlanks' support to variable length charactertypes
Message ID:
1485868F0AD5AC4EB1A9047C9D6FFCE03B682D3E@MAILHYDMB1A.winmail.deshaw.com
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?

Thanks a lot!
Manikantan.

      _____________________________________________
      From: Manikantan, Madhunapanthula_Naaga
      Sent: Friday, June 01, 2012 5:26 PM
      To: dbi-dev@perl.org; dbi-users@perl.org
      Cc: martin.evans@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
      ----
      manikanm@finop2.nyc:~/Driver$<mailto:manikanm@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.
      ---





Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About