Cursors in Functions

From: Dirk Elmendorf <delmendo(at)cymitar(dot)net>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Cursors in Functions
Date: 1998-08-12 20:31:29
Message-ID: XFMail.980812153129.delmendo@cymitar.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there any way to use cursors inside of functions?
I keep trying
CREATE FUNCTION first_purchased_product(int4)
returns text
as 'BEGIN; DECLARE mycursor cursor for SELECT true from product_order_table where customer
_number= $1 order by sec_last_mod ASC ;fetch 1 in mycursor; END;'
LANGUAGE 'sql';

But it won't let me- I need to get 1 product purchased....Anyone know the best way to acco
mplish this?
_________________________________________________________
Dirk Elmendorf, VP/Development Main: 210-892-4000
Cymitar Technology Group, Inc. Direct: 210-892-4005
Lorene Office Plaza Fax: 210-892-4329
9828 Lorene Lane <http://www.cymitar.com>
San Antonio, TX 78216-4450 <delmendo(at)cymitar(dot)com>
_________________________________________________________

Browse pgsql-sql by date

  From Date Subject
Next Message Walt Bigelow 1998-08-12 21:07:45 Re: [SQL] returning the current date in a SQL query
Previous Message Bruce Momjian 1998-08-12 19:42:16 Re: [SQL] returning the current date in a SQL query