views:

149

answers:

1

Sybase ODBC driver have an issue with the decimal data type.

For example, when an application is trying to save in the database a decimal value occurs this error:

ERROR [22018] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'DECIMAL' is not allowed.  Use the CONVERT function to run this query.

Same error occurs when you trying to pass decimal parameter to stored procedure.

How we can fix it using NHibernate or Fluent NHibernate?

Thank you.

A: 

I haven't found simple solution for this. I changed in xml's and POCO's System.Decimal to System.Double and it works. I tried add own sql-insert and sql-update in xml files with CONVERT but it didn't work well (eg. value 5.15 was changed to 515).

Tomek