Decimal's scale Value Error When Filling DataSet

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Decimal's scale Value Error When Filling DataSet

Post by benbahrenburg » Wed 19 Mar 2008 23:04

Hello,

I know this has been raised before but what is the best way to deal with fetching columnar data with greater then 29 decimals into a dataset?

Please keep in mind I need to have this dataset "wired" for update to a grid.

Below is a link where I found it was addressed, but I'm still getting the issue in the latest build 4.50.30

http://crlab.com/forums/viewtopic.php?t ... ht=decimal

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 20 Mar 2008 10:34

Use OracleNumber types in each place of your code,
where you want to get/put values with precision greater than 28.

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Post by benbahrenburg » Thu 20 Mar 2008 16:46

Switched to the OracleDataTable and everything seemed to work without issue.

Thanks for your help.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 20 Mar 2008 16:49

That's great!
Feel free to contact us if you encounter any problems
with OraDirect .NET. Happy programming!

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Post by benbahrenburg » Thu 03 Apr 2008 01:38

Hello,

Found an interesting issue with the OracelDataTable and large numbers.

If you attempt to the OracleDataTable in the standard way included in the Corelab sample within the documentation and select from the below table you'll get the following message:

Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale

I'm using the 4.50.30 build against Oracle 10gR2. Is there a work around for this type of issue, while still using the OracelDataTable since I need to allow the user to update the data through a wired grid.

CREATE TABLE B_TJOTR
(
N FLOAT(126),
V VARCHAR2(10 BYTE)
)
/



SET DEFINE OFF;
Insert into B_TJOTR
(N, V)
Values
(88.1, NULL);
Insert into B_TJOTR
(N, V)
Values
(343, NULL);
Insert into B_TJOTR
(N, V)
Values
(0.00632958471747584, 'FUN');
INSERT INTO B_TJOTR
(N,V)
VALUES
(649301515676727000000000000000000000,'BIGNUMBER');
COMMIT;

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 03 Apr 2008 14:49

This bug is being fixed now.
Thank you for the bug report.
We will fix it as soon as possible.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 03 Apr 2008 15:39

Actually, it's not a bug.
The matter is the following property (you can set it in design time):
OracleDataTable1.ReturnProviderSpecificTypes = true;
And the table will be filled with expected data.

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Post by benbahrenburg » Thu 03 Apr 2008 22:43

Thanks Alex, that did the trick.

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Post by benbahrenburg » Fri 04 Apr 2008 00:00

Ran into something interesting when binding to a grid with .ReturnProviderSpecificTypes = True

It seems as though the OracleDate value is throwing an exception.

Is there anyway to fill an OracleDataTable with .ReturnProviderSpecificTypes=true without running into the OracleDate issue below? It is almost like you'd need the ability to select a data type mapping.

Below is the error I get on the bind event.

System.Reflection.TargetInvocationException: Property accessor 'Value' on object 'CoreLab.Oracle.OracleDate' threw the following exception:'Year, Month, and Day parameters describe an un-representable DateTime.' ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
at CoreLab.Oracle.OracleDate.get_Value()

benbahrenburg
Posts: 25
Joined: Mon 02 Oct 2006 19:15

Post by benbahrenburg » Fri 04 Apr 2008 03:49

Hello,

Thanks for all of your help so far with this. After switching .ReturnProviderSpecificTypes = True the table loads. It does seem to have issues with the OracleDate when binding to a grid. That seems to have been an issue in the MS Provider while ago. I've included the link below.

I'm not sure if I'm using this feature correctly.
If I do the following,

_objDataTable = New OracleDataTable
With _objDataTable
.Connection = myConnection
.ReturnProviderSpecificTypes = True
.SelectCommand = MyCommand
.FetchAll = True
.CachedUpdates = True
.Active = False
.Fill()
End With

I now seem to have additional columns in my data grid such as MyColumnName_IsNull, MyColumnName_Lenght, MyColumnName_Value, etc. This also doesn't allow for me to edit the values within a grid on my form. Is there a method that I can use to get large numbers such as 649301515676727000000000000000000000 and still have an object that I can bind for update against a grid ( within a winform ) ?

It seems as though numbers are the only issue I've run into that causes this "Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale " issue.

Any help would greatly be appreciated since I really not sure to address this.

Oracle Date Link.

http://kbalertz.com/926357/exception-oc ... table.aspx

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Fri 04 Apr 2008 12:08

There are some good samples here:
%Program Files%CoreLab\MyDirect.NET2\Samples\WinForms\
If you won't solve the problem please send me (alexeyman*crlab*com) your project to reproduce the problem.
Do not use third party components.

Post Reply