Re: [CDBI] Problem calling update on a MS SQL Server DB

Ricardo SIGNES <rjbs-perl-cdbi-qhrM8SXbD5J4T/+Z0n4RR9i2O/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
* Steven Mackenzie <steven.mackenzie-5/VXW7sOv/[email protected]> [2006-05-30T09:17:06]
> The error I get seems to be because CDBI has 'quoted' the primary key
> parameter value in the update:
> 
> (Can't update 1: DBD::ODBC::st execute failed: [Microsoft][ODBC SQL
> Server Driver][SQL Server]String or binary data would be truncated.
> (SQL-22001)
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
> terminated. (SQL-01000)(DBD: st_execute/SQLExecute err=-1) [for
> Statement "UPDATE DiscoverySetResources
> SET    title = ?
> WHERE  dsrid=?
> " with ParamValues: 1="Active Navigation :: Information Management
> Solutions", 2='1'] at C:/Perl/site/lib/DBIx/ContextualFetch.pm line 52.
>  at
> C:\cvs\pwebcosm\2.2\ANPerl\AnalysisFramework\Analysis\/AnalyserThematic.pm
> line 221

Why do you think that this has anything to do with PK being quoted?  Did you
read the error message?

It says, "String or binary data would be truncated."  You are only updating one
column, title.  Probably the column definition for "title" cannot store a
string as long as the one you're passing in.  Why don't you check on that?

-- 
rjbs

_______________________________________________
ClassDBI mailing list
ClassDBI-Ra3b/[email protected]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEfFyY5IEwYcR13KMRAkxpAJwMWz9SDkXWidNaexN+4oc65is0dgCfUUE1
0aJx76NyzDl4N4/8jT61aQ8=
=Tpxe
-----END PGP SIGNATURE-----
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.