Reputation: 4359
I have a simple function defined in Postgresql defines as follows
CREATE OR REPLACE FUNCTION Foo(someid_param integer)
RETURNS void AS
$$
BEGIN
DELETE FROM SomeTable WHERE id = someid_param;
END;
$$ LANGUAGE plpgsql;
I've tried using EXEC, SELECT and PERFORM
PERFORM Foo(100);
But I get errors. What is the correct method for calling this function?
I'm using PGAdmin as my development environment.
Upvotes: 3
Views: 6967
Reputation: 17722
PERFORM
belongs to PL/pgSQL, and EXEC
isn't valid SQL. So, you can't use them. You should use
SELECT foo(100);
This should return a single line with an empty column named foo
.
Upvotes: 3