-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot insert boolean using oracle #877
Comments
@dvoaviarisonld I've had this exact same issue. This is the same root cause as #458 but there isn't a released version that includes an equivalent change yet. For now you will need to build it yourself from source. I would recommend checking out the code for the version you have installed and applying one of the TypeHandler fixes yourself. |
Have you tried casting it to an Int? For enums I wish to store as String instead of int I will cast them as string in the values collection, I don't see why that wouldn't work here. Class SomeTable {
bool SomeBoolValue
}
...
var values = new SomeTable{SomeBoolValue = false};
this.conn.ExecuteAsync(sqlQuery, new { SomeBoolValue = (int)values.SomeBoolValue}); |
Only solution I've found to this problem is creating a function in the database;
You can then continue to used named parameters in your SQL;
|
I use dapper 1.60,oracle 11g
TypeHandlerTests.cs |
Thanks for that, worked a treat! |
For anyone hitting this today, check out Dapper.Oracle which has boolean type handlers built-in to save a bit of time: https://github.com/DIPSAS/Dapper.Oracle/ |
sqlQuery variable
Dapper call
That is causing an exception.
I tried to create a BoolTypeHandler but it was not even called by dapper
The text was updated successfully, but these errors were encountered: