Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Triggers and nuBuilder

Post Reply
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Triggers and nuBuilder

Unread post by ruiascensao »

Hi ,

I have setup a trigger to audit my "part" table.
This trigger runs every time the record is UPDATED and copies the OLD values to "part_audit" table.

Every time I update a record on "part" table I get 3 records on the "part_audit" table:

- 1 record with the OLD values;
- 2 records with the NEW updated values;

Why do I get all these records? Is nuBuilder saving more than one time when requested to do so?

Thank you!
BR
Rui
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Triggers and nuBuilder

Unread post by admin »

Rui,

nuBuilder does an insert and then an update, when a new record is created.

This is to cater for users that want autoincremented Primary Keys (a bad choice for so many reasons).

Steven
Post Reply