Re: confused about DBD implementation of ChopBlanks

"Martin J. Evans" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Organization Easysoft Limited
Message-ID <[email protected]>
On 03/01/11 21:03, David Nicol wrote:
> On Mon, Jan 3, 2011 at 8:56 AM, Martin J. Evans
>> I did think of one spolier which I forgot to mention. Currently DBI allows
>>
>> prepare($sql, {ChopBlanks => 1});
>>
>> and ChopBlanks is ignored silently so if you wrote code which understood
>> this and moved to another machine where DBI did not, it would be ignored
>> silently but your code might not work as intended.
> 
> after reviewing the doc and seeing that prepare takes the \%attr I was
> surprised that that doesn't do what you want.

It doesn't.

BTW, when I said what is %attr used for on prepare, I realise it is used to pass driver attributes but that is not obvious from the DBI pod. I don't believe it is currently used for anything DBI specific.

> does
> 
>   my $sth;
>   {
>     local $$dbh{ChopBlanks} = 1;
>     $sth = $dbh->prepare($sql)
>   };
> 
> work?
> 
> 
> 

Yes, that works, it was one of my examples.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
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.