Cursors in Functions - Mailing list pgsql-sql

From Dirk Elmendorf
Subject Cursors in Functions
Date
Msg-id XFMail.980812153129.delmendo@cymitar.net
Whole thread Raw
List 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@cymitar.com>
_________________________________________________________



pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [SQL] returning the current date in a SQL query
Next
From: Walt Bigelow
Date:
Subject: Re: [SQL] returning the current date in a SQL query