On Thu, Mar 8, 2012 at 11:22 AM, Nico Williams <n...@cryptonector.com> wrote:
> I use this all the time as it's the only way in SQLite3 to do UPDATEs
> with JOINs.  I use it with an INTEGER PRIMARY KEY column.  SQLite3
> tables always have a rowid somehow that's suitable for this, but it's
> not a good assumption to bake into an application -- the application
> should make sure that there's an INTEGER PRIMARY KEY or other suitable
> PRIMARY KEY or UNIQUE columns.

I should clarify that this idiom works for: a) using a JOIN as a
source of some of the values to update, b), if the table/view has an
INSTEAD OF INSERT trigger then that can turn the insert of a row in a
single table/view into an insert/update into multiple tables/views.

I find this a very useful pattern.

Nico
--
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to