Okay, here's another one I can't seem to find out!
How do I create stored proc in PostgreSQL? I have found the CREATE FUNCTION command, but from what I can tell, it only returns a single value.
I'd like to have a proc that will, for example, return the fields of a single record whose primary key is passed as a parameter to the stored proc. With SQL Server, I would do something like:
CREATE PROCEDURE test
@ID INT
AS
SELECT * FROM TableName
WHERE ID = @ID
And I could run it using
EXEC test 3
to get the record with ID = 3.
Can this be done in PostgreSQL?
Thanks!
Sylvain Demers