Skip to Content.
Sympa Menu

freetds - Re: [freetds] 'Money' column types need an explicit convert

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 'Money' column types need an explicit convert
  • Date: Mon, 14 Aug 2006 23:44:09 -0400

Daniel Kasak wrote:
> my @values = ( $amount, $self->{clientid} );
>
> $self->{globals}->{common}->dbdo(
> $self->{globals}->{ms_dbh},
> "update Clients set DisputeAmount = ? where ID = ?",
> \@values
> );

Hi Daniel,

In that case, I think "perldoc DBI" is your friend. Have another look at
the bind_param() function; you can pass an attribute list of datatype
hints.

See also odbc_default_bind_type in DBD::ODBC. "DBD::ODBC will attempt to
query the driver via SQLDescribeParam to determine the correct type." I
wonder what "correct" means.

I don't know the state of our SQLDescribeParam(). It might be that we
don't provide DBD::ODBC with the answer it wants in the version you're
using.

My personal solution would be to skip all that. Replace the open SQL with
a stored procedure that accepts CHAR parameters and uses CAST to convert
them explicitly.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page