Received: from thoth.cymitar.com (thoth.cymitar.com [207.71.45.136]) by hub.org (8.8.8/8.7.5) with ESMTP id QAA10869 for ; Wed, 12 Aug 1998 16:31:15 -0400 (EDT) Received: (from delmendo@localhost) by thoth.cymitar.com (8.8.5/8.8.5) id PAA31843 for pgsql-sql@postgreSQL.org; Wed, 12 Aug 1998 15:31:29 -0500 Message-ID: X-Mailer: XFMail 1.3 [p0] on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Wed, 12 Aug 1998 15:31:29 -0500 (CDT) Reply-To: delmendo@cymitar.net Organization: Cymitar Technology Group Inc. Sender: delmendo@thoth.cymitar.com From: Dirk Elmendorf To: pgsql-sql@postgreSQL.org Subject: Cursors in Functions 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 San Antonio, TX 78216-4450 _________________________________________________________