Error writing to double using ODBC

Error writing to double using ODBC

am 20.09.2005 14:11:43 von Wim

I'm having trouble writing to columns of type DOUBLE using ODBC (to
Pervasive.SQL)

$dbh = DBI->connect('dbi:ODBC:DEMODATA','','',{RaiseError => 1, PrintError =>1}) or die $DBI::errstr;
$sth=$dbh->prepare("update mytable set mycolumn=? where id=123") || die $DBI::errstr;
$value=3/2;
$sth->execute($value) || die $DBI::errstr;

Yields:

DBD::ODBC::st execute failed: [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Error converting to numeric type: Parameter #1. (SQL-22018)(DBD: st_execute/SQLExecute err=-1)

My platform:

perl, v5.8.7 built for cygwin-thread-multi-64int
DBI version 1.48
DBD::ODBC vesrion 1.13
Pervasive.SQL 08.60.0192 030

$dbh->column_info correctly gives SQL_DOUBLE

I also tried these but they don't make any difference.

$sth->bind_param(1, $value, SQL_DOUBLE);
$dbh->{odbc_default_bind_type}=SQL_DOUBLE;
$dbh->do("set decimalseparatorcomma=OFF");

Any hints ?

Thanks,

Wim.

RE: Error writing to double using ODBC

am 21.09.2005 23:23:39 von jurlwin

------_=_NextPart_001_01C5BEF2.E22B5682
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Can you try binding it as a varchar? Instead of setting the default =
bind type to SQL_DOUBLE, which will cause more problems than it will =
help for the most part, try setting it to 12 (SQL_VARCHAR)
=20
Thanks,
=20
Jeff

________________________________

From: Wim Livens [mailto:wim@livens.net]
Sent: Tue 9/20/2005 8:11 AM
To: dbi-users@perl.org
Subject: Error writing to double using ODBC




I'm having trouble writing to columns of type DOUBLE using ODBC (to
Pervasive.SQL)

$dbh =3D DBI->connect('dbi:ODBC:DEMODATA','','',{RaiseError =3D> 1, =
PrintError =3D>1}) or die $DBI::errstr;
$sth=3D$dbh->prepare("update mytable set mycolumn=3D? where id=3D123") =
|| die $DBI::errstr;
$value=3D3/2;
$sth->execute($value) || die $DBI::errstr;

Yields:

DBD::ODBC::st execute failed: [Pervasive][ODBC Client =
Interface][LNA][Pervasive][ODBC Engine Interface]Error converting to =
numeric type: Parameter #1. (SQL-22018)(DBD: st_execute/SQLExecute =
err=3D-1)

My platform:

perl, v5.8.7 built for cygwin-thread-multi-64int
DBI version 1.48
DBD::ODBC vesrion 1.13
Pervasive.SQL 08.60.0192 030

$dbh->column_info correctly gives SQL_DOUBLE

I also tried these but they don't make any difference.

$sth->bind_param(1, $value, SQL_DOUBLE);
$dbh->{odbc_default_bind_type}=3DSQL_DOUBLE;
$dbh->do("set decimalseparatorcomma=3DOFF");

Any hints ?

Thanks,

Wim.




------_=_NextPart_001_01C5BEF2.E22B5682--