querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

OracleCompiler generates invalid multiple row insert

Open ceastwood opened this issue 5 years ago • 5 comments

Given the query

db.Query(string table).AsInsert(IEnumerable<string> columns, IEnumerable<IEnumerable<object>> valuesCollection, bool returnId = false);

Compiles to invalid sql for oracle

INSERT INTO "mtable" ("one", "two") VALUES (3348, 0), (3348, 1), (3348, 2)

Implement using from dual union all.

ceastwood avatar Jan 18 '19 20:01 ceastwood

@tlaguz @thowk

If either of you have a chance, please take a look at branch issue-192 issue-192 tree

Not done with refactoring I don't think but the concept is there and the unit test (checked the sql in sql fiddle for oracle) passes.

Thanks.

ceastwood avatar Feb 20 '19 02:02 ceastwood

Once I get a chance, I may boot up a docker container and test-- but that may not be right away

ceastwood avatar Feb 20 '19 02:02 ceastwood

Also just needed this, so bumping this. I didn't check the issue list first and I actually created my own tests+fix for this.

could I assist in getting this accepted?

mathijs-dumon avatar Feb 21 '22 11:02 mathijs-dumon

@ahmad-moussawi ping

mathijs-dumon avatar Feb 22 '22 14:02 mathijs-dumon

I created a new PR with my approach (slightly different) as the branch proposed here is rather old.

mathijs-dumon avatar Feb 24 '22 15:02 mathijs-dumon