pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dirk Elmendorf <delmendo@cymitar.net>
To: pgsql-sql@postgreSQL.org
Subject: Cursors in Functions
Date: Wed, 12 Aug 1998 15:31:29 -0500 (CDT)
Message-ID: <XFMail.980812153129.delmendo@cymitar.net> (raw)

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>
_________________________________________________________





Message-ID: <XFMail.980812153129.delmendo@cymitar.net>
Permalink:  ../XFMail.980812153129.delmendo@cymitar.net/
Also on:    postgresql.org/message-id/XFMail.980812153129.delmendo@cymitar.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: delmendo@cymitar.net
  Subject: Re: Cursors in Functions
  In-Reply-To: <XFMail.980812153129.delmendo@cymitar.net>
  References: <XFMail.980812153129.delmendo@cymitar.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox