erlangbureau / jamdb_oracle

Oracle Database driver for Erlang
MIT License
103 stars 46 forks source link

Join ignored in update_all #158

Closed dfrese closed 5 months ago

dfrese commented 9 months ago

In a query like

      MyRepo.update_all(
        from(t1 in "table1",
          join: t2 in "table2",
          on: t1.id == t2.id
        ),
        set: [value: 0]
      )

the join clause seems to be completely ignored, and an SQL like

UPDATE table1 t0 SET value = 0

is executed.

I could achieve the same thing with a where: t1.id in subquery(...) instead, but I think at least an error should be generated, as the SQL is very different from the Ecto query.

vstavskyi commented 9 months ago

test "CTE update_all"

vstavskyi commented 8 months ago

https://stackoverflow.com/questions/2446764/update-statement-with-inner-join-on-oracle

add error