From: Thomas F. O'Connell <tfo@sitening.com>
To: Flávio Brito <flavio@gral.org.br>
Cc: pgsql-admin@postgresql.org
Subject: Re: Receive a record not a tuple - plpgsql
Date: Sun, 20 Nov 2005 22:42:42 -0600
Message-ID: <7D3B24F0-256E-4DC7-A32B-75ABEE53D83F@sitening.com> (raw)
In-Reply-To: <1132172491.26344.13.camel@localhost>
References: <1132172491.26344.13.camel@localhost>
On Nov 16, 2005, at 2:21 PM, Flávio Brito wrote:
> How can I call a function into a function? My problem is: I'm
> trying to calculate a tax(inss) over a employer salary. I created a
> function called inss that do it correctly, but when I create
> another one to show more attributes (inss is not a attribute, it is
> calculate over a salary) I receive a record (like {1,Mary,32.45}
> not a tuple. How can I solve it?
Have you looked into set-returning functions? It seems like that
might be what you're looking for:
http://www.postgresql.org/docs/8.1/static/plpgsql-control-
structures.html#PLPGSQL-STATEMENTS-RETURNING
--
Thomas F. O'Connell
Database Architecture and Programming
Co-Founder
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-469-5150
615-469-5151 (fax)
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-admin@postgresql.org
Cc: tfo@sitening.com, flavio@gral.org.br
Subject: Re: Receive a record not a tuple - plpgsql
In-Reply-To: <7D3B24F0-256E-4DC7-A32B-75ABEE53D83F@sitening.com>
References: <1132172491.26344.13.camel@localhost> <7D3B24F0-256E-4DC7-A32B-75ABEE53D83F@sitening.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