Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifing TRIGGER

Status
Not open for further replies.

lupos

Programmer
Joined
Sep 5, 2006
Messages
2
Location
PL
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top