From: Jeff Smelser Date: April 21 2006 6:40pm Subject: Re: Loop Trigger List-Archive: http://lists.mysql.com/mysql/197167 Message-Id: <200604211340.50403.tradergt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1338613.e9QgkVL9GY"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1338613.e9QgkVL9GY Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 19 April 2006 11:10, Lucas Vendramin wrote: > Hi all. > I am creating a trigger that update the some table witch call it. > Ex: > create table t1 ( > id int, name varchar(50), c int default 0, father int, > primary key(id), > index (father), > foreign key (father) references t1(id) on update restrict on delete > restrict ); > create trigger tg_t1 > before update on t1 > for each row > begin > update t1 set c=3Dc+1 where father=3DNEW.id; > end; set NEW.c =3D NEW.c + 1; or whatever. You dont update on a before trigger..=20 Jeff --nextPart1338613.e9QgkVL9GY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBESScyoOk9EvUvEtgRAvaUAKClirUVvgD2RrO8AKi7fCF718r8EACfb8i1 KkKSowRV6oN76pnGxGRjvoY= =YYa6 -----END PGP SIGNATURE----- --nextPart1338613.e9QgkVL9GY--