You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgraded my .Net DataProvider from 2.5.2 to 2.6.5.
A simple select query that ran with no problems using the 2.5.2 version, will now throw an exception when using the 2.6.5 version.
When I execute a query with a (string)parameter value that is longer than the size of the column in the database an IscException occurs.
the error code is: 335544321 and the message is 'Arithmetic overflow or division by zero has occurred. arithmetic exception, numeric overflow, or string truncation. string right truncation.'
If it is possible I would like the behaviour of the 2.5.2 version back, because it makes my code a lot simpler. Otherwise I have to make sure a user can not enter data that will result in an exception.
The text was updated successfully, but these errors were encountered:
That is a problem. I can not change the whole user interface to prevent the users to enter too long strings.
Furthermore I have to check my code in all places that the values I use to query the database are not longer than the columns, or in case of expressions, longer than the combined columns.
It seems, but I did not check this extensively, that the value of the parameter will be truncated when the length of the parameter is set.
I think this will result in incorrect results when the value in the parameter is truncated and coincidentally is equal to a value in the database that has the maximum length of the column.
I hope this is not the case, because that will produce the wrong results in my application.
Because I was not sure, that the behaviour in the new version is not the correct behaviour.
I also checked how, for instance, Sql-server handles the case.
In Sql-server no exception is thrown and no results are returned. Which is exactly what I would like the .Net Data Provider to do.
By the way, I am very much pleased with the .Net DataProvider and this is the first issue I have run into since we are using the .Net dataprovider.
The value is truncated to size you specify, be it whatever value you feel comfortable. If you look at tracker items, you'll find this behavior was done to align with SqlClient.
Submitted by: Ruben Rorije (rubenrorije)
I upgraded my .Net DataProvider from 2.5.2 to 2.6.5.
A simple select query that ran with no problems using the 2.5.2 version, will now throw an exception when using the 2.6.5 version.
When I execute a query with a (string)parameter value that is longer than the size of the column in the database an IscException occurs.
the error code is: 335544321 and the message is 'Arithmetic overflow or division by zero has occurred. arithmetic exception, numeric overflow, or string truncation. string right truncation.'
If it is possible I would like the behaviour of the 2.5.2 version back, because it makes my code a lot simpler. Otherwise I have to make sure a user can not enter data that will result in an exception.
The text was updated successfully, but these errors were encountered: