Hi,
I was wondering if anyone can tell me if this function follows ANSI SQL standard, and for future reference are there any resources that i can use to find if my SQL conforms to ANSI standards. And the DBMS i am using is MySQL.
CREATE FUNCTION INCREMENT()
RETURNS INT
BEGIN
DECLARE old INT;
DECLARE new INT;
SELECT current INTO old FROM table FOR UPDATE;
SET new=old +1;
UPDATE table SET current=new;
RETURN new;
END;
Thanks.
I was wondering if anyone can tell me if this function follows ANSI SQL standard, and for future reference are there any resources that i can use to find if my SQL conforms to ANSI standards. And the DBMS i am using is MySQL.
CREATE FUNCTION INCREMENT()
RETURNS INT
BEGIN
DECLARE old INT;
DECLARE new INT;
SELECT current INTO old FROM table FOR UPDATE;
SET new=old +1;
UPDATE table SET current=new;
RETURN new;
END;
Thanks.