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

Oracle Error ORA-00933 (SQL command not properly ended) on insert of many entities #662

Open
NunzioCar opened this issue Feb 16, 2023 · 0 comments

Comments

@NunzioCar
Copy link

Oracle: Oracle Database 21c Express Edition
SQLKata: 3.2.3
.NET 6

C#:

var columns = new [] {"Name", "Price"};

var valuesCollection= new [] {
    new object[] { "A", 1000 },
    new object[] { "B", 2000 },
    new object[] { "C", 3000 },
};

var result = await _db
                 .Query("Products")
                 .InsertAsync(columns, valuesCollection, cancellationToken: cancellationToken);

Compiled SQL Query:

INSERT INTO "Products" ("Name", "Price") VALUES (?, ?), (?, ?), (?, ?)

Error:

ORA-00933 SQL command not properly ended

However if I downgrade to SQLKata version 3.0.0-beta the insert works properly and the compiled SQL Query is:

INSERT ALL 
    INTO "Products" ("Name", "Price") VALUES (?, ?) 
    INTO "Products" ("Name", "Price") VALUES (?, ?) 
    INTO "Products" ("Name", "Price") VALUES (?, ?) 
SELECT 1 FROM DUAL

and I noted that the field MultiInsertStartClause of OracleCompiler no longer exists.

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

No branches or pull requests

1 participant