use miniloan;set global log_bin_trust_function_creators = 1;DELIMITER $$CREATE DEFINER='miniloan'@'%' FUNCTION currval (name VARCHAR(50)) RETURNS int(11)DETERMINISTICBEGIN DECLARE VALUE INTEGER; SET VALUE = 0; SELECT seq_value INTO VALUEFROM 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) DETERMINISTICBEGIN UPDATE sequence SET seq_value = seq_value + 1 WHERE seq_name = name; RETURN currval(name); END $$