Invalid cast of Decimal parameters used in Firebird stored procedures.
----------------------------------------------------------------------
Key: DNET-296
URL: http://tracker.firebirdsql.org/browse/DNET-296
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Affects Versions: 2.5.2, 2.5.1
Environment: Windows XP SP2 (32 bit), Firebird embeded 2.1, Firebird
Client 2.5.1 and 2.5.2.
Reporter: Dean Thrasher
Assignee: Jiri Cincura
Priority: Minor
Original issue documented on Stack Overflow:
http://stackoverflow.com/questions/2208575/using-decimal-parameters-in-firebird-stored-procedures
I've pasted some of the issue here for reference:
I have a Firebird stored procedure that accepts Decimal(9,6) values for
Latitude and Longitude parameters. It's used to create a contact profile for a
user.
When I try to create and use these decimal parameters, I get a conversion error:
Value was too large or too small for an Int32.
The procedure works fine if the values for GeoLat and GeoLong are integer
values (such as 72 or 0), but if I try to pass a decimal value, it fails.
[...details omitted...]
I tried to build the .NET data provider from the source code. But I get a
compile error at line 731 of GdsStatement.cs.
int processedItems = (rowDescs[part] != null ? rowDescs[part].Count : 0);
The error is:
There exist both implicit conversions from "short" to "int" and from "int"
to "short".
Changing line 731 to this:
int processedItems = (rowDescs[part] != null ? (int) rowDescs[part].Count : 0);
Allows the code to compile on my machine.
After making this code change, I was able to run my tests and use Decimals in
my stored procedure successfully.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider