Trigger to reset auto increment after the table empty
hi, i am new to mysql and is processsing to migrate from firebird to mysql.
can anyone help me create for my case
i want to create trigger
to reset autoincrement after emptying row on table
and this trigger event is on delete row
this my trigger syntax on firebird :
DECLARE VARIABLE L_VARIABLE INTEGER;
BEGIN
SELECT FIRST 1
ID
FROM
JENISJURNAL
INTO
:L_VARIABLE;
IF (L_VARIABLE IS NULL) THEN
EXECUTE STATEMENT 'ALTER SEQUENCE GEN_JENISJURNAL_ID RESTART WITH 0';
END;
i already try on mysql but always show error
thx
Subject
Views
Written By
Posted
Trigger to reset auto increment after the table empty
4247
April 25, 2014 12:55AM
2022
April 25, 2014 02:44AM
1664
April 25, 2014 02:49AM
1568
May 03, 2014 09:08PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.