Thread: sql function examples requested (! select)

sql function examples requested (! select)

From
Sue Humphrey
Date:
I would like examples of functions using update, insert and
delete, where LANGUAGE 'SQL', both how to write them and how to
use them.

I've got examples of functions as selects coming out of my ears,
and PL/pgsql examples of more complex needs, but I just need to
run a simple UPDATE.  And I forsee an immediate need to do
deletes the same way.

Please feel free to either respond to the list, or in email, as
I subscribe to both.

Sue

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com


Re: sql function examples requested (! select)

From
Tom Lane
Date:
Sue Humphrey <sue_humphrey@yahoo.com> writes:
> I would like examples of functions using update, insert and
> delete, where LANGUAGE 'SQL', both how to write them and how to
> use them.

Have you read the documentation?

http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/xfunc-sql.html

The first couple of examples seem to cover the territory ...
        regards, tom lane