Hello community,

I am a little bit confused by instead of update trigger logic.

Lets say there is a trigger MYTRIGGER which is an INSTEAD OF UPDATE trigger
that belongs to view named MYVIEW.
MYTRIGGER should update table MYTABLE with values sent from an application.

 UPDATE MYTABLE
       SET *primary = new . primary; *
             * field2    = new . field2*,
              *field3    = new . field3*
 WHERE *primary = old.primary;*

So user decides to modify a record. He changes *primary, field2,
field3*values trough textboxes, and the app sends parametarised update
query to
sqlite engine.

UPDATE MYVIEW
     SET *primary = @a*,
            *field2    = @b*.
            *field3    = @c*;

Since *primary* is not a surrogat key, and the user has changed it, there
is no way to and including it in a where clause.

My question is: does sqlite engine know the *old value of primary field*?
If yes, HOW? Is trigger executing once or for each row?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to