On 2014/03/06 18:41, Tilsley, Jerry M. wrote:
I would like to create the following INSTEAD OF INSERT trigger:
create trigger insteadInsertPanelTracker instead of insert on
panel_tracker begin set @ov_id = select ov_id from ov_systems where
mt_mnemonic=NEW.ov_id; insert into panel_tracker values (@ov_id,
NEW.mt_acct, NEW.orm_id, NEW.panel_code); end ;
At this point it is probably just easier to do an initial call to the database to lookup the value I want, then send in the insert. I thought a trigger would be a nice way to keep my other code cleaner, but I guess not.

If I may offer some advice - In stead of telling us what you have done and asking what is wrong with it, why don't you simply state exactly what you want to achieve (along with all schemata), and ask what the best way to do so is? You will be amazed at the solutions some of these geniuses can come up with.


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

Reply via email to