Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: DBI and money columns

by PotPieMan (Hermit)
on Aug 31, 2000 at 06:57 UTC ( [id://30459]=note: print w/replies, xml ) Need Help??


in reply to DBI and money columns

I haven't coded in the DBI for a while now. Nonetheless, I would try binding parameters using $sth->bind_param(). For instance, given that $dbh is a valid database handler:
$sth->prepare("UPDATE table SET column_1 = ? WHERE id = 1"); $sth->bind_param(1, 221783, { TYPE => SQL_VARCHAR }); $sth->execute();
According to Programming the Perl DBI, DBD::ODBC supports placeholders, so hopefully this will work.

This does not mean that the module supports money columns--you'll have to try the type_info() and type_info_all() methods, as in:

print $dbh->type_info_all();
This will (hopefully) return all the datatypes supported by Microsoft SQL Server and DBD::ODBC. I can't really answer for sure, as I do not use SQL Server or ODBC.

Hope this helps.

-ppm

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://30459]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2025-06-12 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.