Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PostgreSQL Stored Proc
Message
De
02/11/2001 15:40:33
 
 
À
Tous
Information générale
Forum:
Linux
Catégorie:
Problèmes base de données et Admin
Titre:
PostgreSQL Stored Proc
Divers
Thread ID:
00576980
Message ID:
00576980
Vues:
52
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform