From: Richard Huxton <dev@archonet.com>
To: Sylvain Racine <syracine@sympatico.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Function not return zero record
Date: Thu, 03 Aug 2006 18:29:26 +0100
Message-ID: <44D23276.4090100@archonet.com> (raw)
In-Reply-To: <BAYC1-PASMTP0542B98360BDDF31F757D8FD530@CEZ.ICE>
References: <BAYC1-PASMTP0542B98360BDDF31F757D8FD530@CEZ.ICE>
Sylvain Racine wrote:
> Hello,
>
> I wrote a simple function who checks in a table an address and returns
> the id and coordinates of the corresponding address.
>
> The problem is when I run separately the SQL query, it gives me zero (0)
> entry when I submit a new address - it is what I want as result - and
> when I run my function, it gives me 1 entry with the same address.
>
> Note: I create a pseudo-type to return the result. Is that my problem?
The problem is the difference between a value of type getCache and a set
of values of type getCache.
Define your function as returning a SETOF getCache
Call it with SELECT * FROM getCache(...)
HTH
--
Richard Huxton
Archonet Ltd
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, syracine@sympatico.ca
Subject: Re: Function not return zero record
In-Reply-To: <44D23276.4090100@archonet.com>
* 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