From: | Ed Loehr <eloehr(at)austin(dot)rr(dot)com> |
---|---|
To: | Graeme Merrall <graeme(at)clubnet(dot)net(dot)au> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: On functions and stored procs |
Date: | 2000-04-19 14:03:23 |
Message-ID: | 38FDBCAB.87898DBC@austin.rr.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Graeme Merrall wrote:
>
> I'm just getting into functions in postgres and I've bumped up against a
> couple issues which I think I need explained. I've had a wee read of the
> archives on this but haven't turned up to much. I think it may be a
> conceptual problem on my part though :)
>
> Is it possible on postgres, using pl/pgsql to create a function that is
> essentially a stored procedure? i.e. go through and execute a series of SQL
> statements and return a value - success or failure for example.
Yes, this is possible with plpgsql. Note you're limited to returning one
value, not a relation.
> Aditionally, from reading the docs on pl/pgsql is it possible to loop
> through a set of rows returned from a query and perform an action on each
> iteration?
Yes.
> Any examples of this sort of thing?
.../src/test/regress/sql/plpgsql.sql
> Quiet obviously, the docs generally need
> updating when it comes to functions. Is there a documentation project/team?
www.postgresql.org
>
> Regards,
> Graeme
From | Date | Subject | |
---|---|---|---|
Next Message | Jurgen Defurne | 2000-04-19 17:08:59 | Re: What are your using it for? |
Previous Message | Javier Benito | 2000-04-19 09:29:34 | Sorry, I forgot put the exception in my message... |