distal-attribute
distal-attribute
distal-attribute
distal-attribute

can't create stored procedure for postgresql db

cvb255 posted 9 months ago in Running SQL scripts

when create procedure for postgresql

CREATE OR REPLACE FUNCTION func_test(code integer) RETURNS INTEGER AS $$

BEGIN

return 1;

END; $$ LANGUAGE plpgsql;

1 attachment(s):
  • HeidiSQL_9.4_ERROR
ansgar posted 9 months ago

You are using semicolon in the procedure code itself, and HeidiSQL splits queries at these places. So you are actually executing the code up to and including "return 1". You need to add such a line above the whole query:

DELIMITER //
CREATE OR REPLACE ...

Don't forget to reset the delimiter afterwards:

DELIMITER ;

Please login to leave a reply, or register at first.