Lundsby wrote:
That's exactly what happens ODP.Net automatically tries to convert it to System.Decimal and fails. In fact the only way that I can get the value from ODP.Net is to use GetOracleDecimal, which in turn means the value returned must be an OracleDecimal.
Hmm. But then I can't fix it, as it would require oracle specific code in the generic data fetcher logic. The only way would be that the datareader is passed on to a database specific object, which reads all fields, however when to decide to use a specific method? This could only be determined based on pre-defined data, for example in the designer, where a specific settings should be added to allow the user to specify a conversion. Pretty awkward.
The way I imagine it could be implemented is to generate conversion logic in special case where the returned value is an Number with unidentified length and precision. Other fields then these should not go through any conversion.
To determine that special case is IMHO impossible, as the value in the datareader cell can't be read. So first it has to be read, then an exception follows, which then should result in a database specific action, however which one, as Oracle has more type specific classes.
Implementing this feature would make LLBL much more usefull in Oracle scenarios involving time consuming calculations, where Materialized views are often used. This is often the case in the financial sector.
If the materialized view has number precision and scale defined, would it then be solved? I'm reluctant to throw away the generic design of the core engine just because ODP.NET gives an error in a very specific situation.
The real problem is that the datareader already gives the exception. If it would have contained an OracleDecimal object, and later on the error would have been produced, the conversion routine could have been added to template code even.