I read the documentation on postgres site (http://techdocs.postgres.sql) 
and then also the Google search and came up with this:

The way PostgreSQL usees stored procedures is like this:
"A stored procedure is really a function"
It just does INSERT/UPDATE/DELETE, multiple DELETE or 
whatever.  So to write them use a function but just call it "stored 
procedure"  fancy...

Heres some code that I've never tested or run before:

CREATE FUNCTION putData (char, varchar, varchar) RETURNS int
AS '
                x ALIAS FOR $1;
                y ALIAS FOR $2;
                z ALIAS FOR $3;
                INSERT INTO tableA (colX, colY, colZ) VALUES (x, y, z);
                RETURN 1;
' LANGUAGE 'plpgsql';

Good Luck

David Busby wrote:
> List,
>     I'm using a postgres datbase for my PHP project, how do I make 
> stored procedures?  Or if no SPs then what would be recomendation for 
> building simple/reuseable "Put" and "Get" procedures for my data?
> /B

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to