Re: declare function with IN and OUT parameter as well as refcursor

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Frank Motzkat/IC3S AG <frank(dot)motzkat(at)ic3s(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: declare function with IN and OUT parameter as well as refcursor
Date: 2005-11-24 08:31:04
Message-ID: 20051124083103.GB18750@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 24, 2005 at 09:26:07AM +0100, Frank Motzkat/IC3S AG wrote:
> Hi community,
>
> I would like to declare a function with IN and OUT parameters as well as a refcursor as return value.
>
> For example something like this:
>
> This doesn???t work. It gives the compilation error ???ERROR: function result type must be integer because of OUT parameters???

<snip>

Well in that case you've said the output is an integer, and you're
returning a refcursor, hence the error. In the second case you don't
have any out parameters, so it understands you're trying to return the
refcursor.

I suppose you could declare the refcursor as an OUT parameter, or
return the integer in the first case,

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rembrandt 2005-11-24 08:37:57 Set a blank password for a db user
Previous Message Frank Motzkat/IC3S AG 2005-11-24 08:26:07 declare function with IN and OUT parameter as well as refcursor