Steve Northamer writes:
> So my questions are: 1) How do we cause the paymentcalc function to be
> executed only once?
In recent versions, I think marking it volatile would be sufficient.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> So my questions are: 1) How do we cause the paymentcalc function to be
> executed only once? and 2) How do we call a table returning function with
> inputs from a table?
>
> Thank you very much!
>
> Steve
>
WITH func AS (
SELECT FUNC(...) AS func_result FROM ...
)
SELECT (func.func_re
We have a plpgsql function called paymentcalc, which calculates the
payment necessary to pay off a loan. It's defined like this:
CREATE OR REPLACE FUNCTION paymentcalc(IN amount numeric, IN
interestrate numeric, IN termmonths integer, IN paymentfreq integer, IN
dueday1 integer, IN dueday2 i