Sorry, another PostgreSQL question.
Consider the following script:
CREATE OR REPLACE FUNCTION test_function (
myParam VARCHAR
)
RETURNS INTEGER
AS
$BODY$
declare
myVar integer;
begin
return now();
end;
$BODY$
LANGUAGE plpgsql
;
When I run in pgAdmin, all is well.
But running it in HeidiSQL, I get the following error message:
CREATE OR REPLACE FUNCTION test_function (
myParam VARCHAR
)
RETURNS INTEGER
AS
$BODY$
declare
myVar integer;
/* ERROR: unterminated dollar-quoted string at or near "$BODY$
declare
myVar integer"
LINE 7: $BODY$
^ */
It seems like Heidi is not passing the entire statement to the server. Heidi seems to ignore $BODY$ and assumes the statement ends at the first semicolon.
How to fix?
Thanks, Dave