Skip to content
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

Batch update boolean type error with Oracle.EntityFrameworkCore: ORA-00932 #682

Open
NepPure opened this issue May 8, 2021 · 4 comments
Assignees

Comments

@NepPure
Copy link

NepPure commented May 8, 2021

Z.EntityFramework.Plus v5.1.33.0

Oracle.EntityFrameworkCore v5.21.1 with Oracle 19

ora-00932 inconsistent datatypes expected number got boolean

image

@JonathanMagnan JonathanMagnan self-assigned this May 10, 2021
@JonathanMagnan
Copy link
Member

Hello @NepPure ,

Do you think you could provide a runnable project sample for this issue? It will help my developer to get started to investigate it faster and make sure nothing is missing.

The last time someone reported us this error, a converter was missing on his side:

protected override void OnModelCreating(ModelBuilder builder)
{
                builder.Entity<EntitySimpleBool>().Property(x => x.IsDeleted).HasConversion(x => x ? 1 : 0, x => x == 1);
}

Providing a project sample is now REQUIRED. It happened too many times that something was missing to investigate and/or answer an issue.

Try to create a new project with only the minimal code (having too many non-related codes doesn’t help either).

You can send it to info@zzzprojects.com if you need to keep the source private

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@NepPure
Copy link
Author

NepPure commented May 10, 2021

Thank you very much, I will try it as soon.

My project needs to support multiple relational database types at the same time. I think this conversion should only apply to Oracle. The configuration here seems unreasonable, or when using Oracle database, should I add a global conversion like this to the Bool type?

Should it be built into the Oracle of Z.EntityFramework.Plus?

There is no problem in updating the Bool type using EFCore's native method.

@JonathanMagnan
Copy link
Member

We already tried to fix it by default through another request but meanwhile, the only solution is to add a conversion when you are using the Oracle provider. You probably know when your context uses Oracle so you can add a condition here.

As said, we already working to make it works by default. So it might get fixed in the upcoming week.

@NepPure
Copy link
Author

NepPure commented May 11, 2021

protected override void OnModelCreating(ModelBuilder builder)
{
                builder.Entity<EntitySimpleBool>().Property(x => x.IsDeleted).HasConversion(x => x ? 1 : 0, x => x == 1);
}

When code first, add conversion like this will change the migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants