use miniloan; set global log_bin_trust_function_creators = 1; DELIMITER $$ CREATE DEFINER='miniloan'@'%' FUNCTION currval (name VARCHAR(50)) RETURNS int(11) DETERMINISTIC BEGIN DECLARE VALUE INTEGER; SET VALUE = 0; SELECT seq_value INTO VALUE FROM sequence WHERE seq_name = name; RETURN VALUE; END $$
use miniloan; set global log_bin_trust_function_creators = 1; DELIMITER $$ CREATE DEFINER='miniloan'@'%' FUNCTION nextval(name VARCHAR(50)) RETURNS int(11) DETERMINISTIC BEGIN UPDATE sequence SET seq_value = seq_value + 1 WHERE seq_name = name; RETURN currval(name); END $$