views:

97

answers:

1

The table stores file names. The primary key is an auto-incrementing integer. A search using the result set works. And calling the delete method generates the following error message:

DBIx::Class::Relationship::CascadeActions::delete(): DBI Exception: 
DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Invalid 
precision value (SQL-HY104) [for Statement "DELETE FROM tblComplaintAttachment 
WHERE ( ID = ? )" with ParamValues: 1='8.4.9.3.0.'] at Dups.pl line 17

ID is the primary key. If I print ID, it shows 84930 - without the periods. Any ideas why delete generates the error?

The database is SQL Server 2000. I am using DBIx::Class with Strawberry Perl under Windows XP.

A: 

From DBIx::Class::Storage::DBI::ODBC. I'm not sure that's exactly the problem, but it may serve as a starting point to you.

KNOWN ACCESS PROBLEMS ^

Invalid precision value

This error message is received when trying to store more than 255 characters in a MEMO field. The problem is (to my knowledge) an error in the MS Access ODBC driver. The problem is fixed by setting the data_type of the column to SQL_LONGVARCHAR in add_columns. SQL_LONGVARCHAR is a constant in the DBI module

Pedro Silva
Thanks for pointing that out. This field is an integer - not a Memo. I have the size set as 4. Should I use a different size for integers?
Robert Wohlfarth
Are you sure the field is an `int`? My understanding is that in Sql Server, `int` fields don't have the precision property. And isn't '8.4.9.3.0.' a suspicious value for a primary key?
Pedro Silva