Re: DBD::Oracle, Support binding of integers so they are returned as IVs

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Sat, Nov 28, 2009 at 11:05:31AM +0100, H.Merijn Brand wrote:
> > > 
> > > Does anyone know if there are other databases that have mapping issues with
> > > integers and Perlish integers other than Oracle? Just curious, as I only
> > > personally know how a handful deal with ints internally.
> > 
> > DBD::SQLite returns only strings, along with most of the pure-perl
> > drivers, like DBD::CSV.
> 
> The plan is still in my head to convert PV("1"\0) to IV(1) if the field
> type is numeric on fetch. Low priority though. Probably needs some work
> in DBD::File

Well, if this was done:

> > Which makes me wonder if $sth->_set_fbav(\@row), which is used by most
> > pure-perl drivers to store each row, should call sql_type_cast()
> > automatically.

then it would take no work in DBD::File at all. Applications that
actually want IV/UV/NV's for some columns could simply use bind_col() to
ask for it. Also, being done in C, it would also be much faster than a
pure-perl addition to DBD::File.

Tim.

p.s. Seems like there's a reasonable case for restoring the old initial
\%attr of bind_columns() method: $sth->bind_columns({ TYPE => SQL_NUMERIC });
The 'harmless' nature of the SQL_NUMERIC semantics we've adopted make
that quite useful.
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.