I'm creating datebase in sqlite. I got few tables. When I change ID in
table WHO_BUY it should also change in table HOW_MUCH_BUY. It is not a
problem I create trigger like this.
CREATE TRIGGER who_buy_update_id
AFTER UPDATE ON who_buy
BEGIN
UPDATE how_much_buy_dane SET id = new.id WHERE
how_much_buy.id = old.id;
It works fine but i got in my table HOW_MUCH_BUY key which is UNIQUE
it is based on fields date_id_tranaction where transaction is buy or
sale
my question is:
how to modyfiy trigger to change also key in my table
example:
key
2007-11-01_XXX_buy
id
XXX
date
2007-11-01
after change in table WHO_BUY field id to XYZ i should have
id
XYZ
key
2007-11-01_XYZ_buy
table WHO_BUY it should also change in table HOW_MUCH_BUY. It is not a
problem I create trigger like this.
CREATE TRIGGER who_buy_update_id
AFTER UPDATE ON who_buy
BEGIN
UPDATE how_much_buy_dane SET id = new.id WHERE
how_much_buy.id = old.id;
It works fine but i got in my table HOW_MUCH_BUY key which is UNIQUE
it is based on fields date_id_tranaction where transaction is buy or
sale
my question is:
how to modyfiy trigger to change also key in my table
example:
key
2007-11-01_XXX_buy
id
XXX
date
2007-11-01
after change in table WHO_BUY field id to XYZ i should have
id
XYZ
key
2007-11-01_XYZ_buy