[Catalyst] Field types and Sybase

Jonathan Batchelor jmb at atuin.co.uk
Mon Jan 29 17:46:40 GMT 2007


I have a problem with one of the field types set up in my Database and 
wondered if anyone can help me to define it within my model properly. 
The error I get is as follows:

Caught exception in ReCharge::Controller::Contracts->url_create 
"DBIx::Class::ResultSet::create(): Error executing 'INSERT INTO 
contracts (amount, contract, end_date, start_date) VALUES ('1000', 
'Test', '12/31/07 23:59:59', '01/01/07 00:00:00')': Server message 
number=257 severity=16 state=1 line=1 server=DBSERVER text=Implicit 
conversion from datatype 'VARCHAR' to 'MONEY' is not allowed.  Use the 
CONVERT function to run this query."

The database is Sybase and this field is of type "MONEY" (as you can 
see), I think just inserting as a normal integer (i.e. without the 
quotes in the SQL) is all that is required.

I have searched all over for information on how to specify the data 
type, but have found it quite confusing!

Thanks in advance for any assistance,
Jonathan.



More information about the Catalyst mailing list