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

Steven Mackenzie steven.mackenzie at aptile.co.uk
Tue May 30 16:37:34 BST 2006



Ricardo SIGNES wrote:

>* 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? 
>
My preconceptions.

> Did you
>read the error message?
>  
>
Yes, and Googled for SQL-22001, and obviosly failed to understand what I
read there too ...

>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?
>
>  
>
Thanks.  Fixed now.  More messages to read now.




More information about the ClassDBI mailing list