-
Notifications
You must be signed in to change notification settings - Fork 98
Cannot convert between numeric types when fetching a value #177
Comments
had the same issue with fetching integers from stored procedure select output
mapper
exception
however I found a workaround and it worked hopefully guys you will look into this issue and provide a fix
|
Generally speaking, numeric conversions make only sense if the returned data type is already numeric. Parsing e.g. |
just for clarity, are you saying select 1 does not return 1 as numeric? |
No, not necessarily. It's just to clarify that we should not expect conversion across incompatible base types (character types to numeric, character types to dates, and such). |
Why not? ISO/IEC 9075-2:2016(E) 6.13 <cast specification> specifies a wide variety of conversions that should be supported from character types to/from others, including numeric, temporal, boolean. I've always found that very convenient in JDBC, and I'm pretty sure users will expect this convenience from R2DBC as well. |
A broad brush of cross-type conversion an aspect targetting all drivers. We avoided from the start requiring all drivers to do the exact same work. I'd rather suggest having a layer that would take care of this. R2DBC proxy is a good place to place such cross-cutting concerns in a single place. |
Hi there, Great thanks for your suggestion. Apologies for the late reply. I'm also considering this, let me explain the conversion failure exception: The query But, yes, it seems like make confuse to user: I call the method with parameter In addtion, just like @mp911de said, the driver layer should not consider a broad brush of cross-type conversion. I'm following up on this ticket and it will be resolved soon. |
This query currently fails:
The exception being:
See also: r2dbc/r2dbc-h2#190
The text was updated successfully, but these errors were encountered: