I have the following stored procedure or function defined in my Postgresql database:
CREATE OR REPLACE FUNCTION insert_val(int)
$body$
BEGIN
FOR i IN 1..10 LOOP
insert into test (val)
values($23);
END LOOP;
END;
$body$ Language 'plpgsql' VOLATILE;
I just want to insert this data inside of a loop, but I get always this error:
Syntaxfehler bei »begin«
Is maybe that I missed something in my function?