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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With