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

Ricardo SIGNES rjbs-perl-cdbi at lists.manxome.org
Tue May 30 15:54:16 BST 2006


* Steven Mackenzie <steven.mackenzie at aptile.co.uk> [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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.digitalcraftsmen.net/pipermail/classdbi/attachments/20060530/8ceec62b/attachment.pgp


More information about the ClassDBI mailing list