Simple stored procedure examples?

From: novnov <novnovice(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Simple stored procedure examples?
Date: 2006-11-04 04:45:25
Message-ID: 7171726.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm completely new to pgsql, using 8.1 and pgAdmin III. I'm not finding a lot
of bare bones simple example stored procs that I can learn from. It would be
very helpful if someone could show me some simple code.

In the pgAdmin interface I've been picking SQL as the language, that's the
default it offers.

Say I have a table Item, and fields ItemID (int4) and ItemName (varchar).
What would be the code for

#1 updating ItemName for all rows to 'fox'

#2 updating ItemName for row where ItemID = 2 to 'fox'

#3 updating ItemName for row where ItemID = 3 to a param value passed in

That would be so helpful...I've tried and get errors like "ERROR relation
"item" does not exist", and of course the table Item and the column ItemName
do exist, haven't been able to figure out what the error means.
--
View this message in context: http://www.nabble.com/Simple-stored-procedure-examples--tf2572616.html#a7171726
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas H. 2006-11-04 04:46:12 Re: Can PostgreSQL reside on the same server as MSDE?
Previous Message Shane Ambler 2006-11-04 04:33:14 Re: Can PostgreSQL reside on the same server as MSDE?