Ditutup

Mysql Triggers

We have some triggers that are not fucntioning properly and we are unable to identify the problem.

The triggers perform a simple increment and decrement of a counter when rows are inserted and deleted into a table.

Increment_AUL AFTER INSERT

--------------------------

BEGIN

IF [url removed, login to view] in ('Global','Local','Instant') THEN

UPDATE owner_aul set active = active + 1 WHERE oid =

(SELECT oid FROM poh WHERE [url removed, login to view] = hid);

ELSEIF [url removed, login to view] = 'Free' THEN

UPDATE owner_faul set active = active + 1 WHERE oid =

(SELECT oid FROM poh WHERE [url removed, login to view] = hid);

END IF;

END

Decrement_AUL AFTER DELETE

--------------------------

BEGIN

IF [url removed, login to view] in ('Global','Local','Instant') THEN

UPDATE owner_aul set active = active - 1 WHERE oid =

(SELECT oid FROM poh WHERE [url removed, login to view] = hid);

ELSEIF [url removed, login to view] = 'Free' THEN

UPDATE owner_faul set active = active + 1 WHERE oid =

(SELECT oid FROM poh WHERE [url removed, login to view] = hid);

END IF;

END

Kemahiran:

Lihat lebih lanjut: hid global, mysql free, free mysql, update mysql, local free, begin, rows insert, mysql delete, select deleted, mysql inserted, insert mysql table, identify problem, mysql insert update , unable, increment decrement counter, mysql update table, insert mysql, mysql problem, instant mysql update, triggers, simple table mysql, mysql triggers, select select mysql, oid, mysql select

Tentang Majikan:
( 4 ulasan ) Dromore, United Kingdom

ID Projek: #98117