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
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_result).*
Steve Northamer stevenortha...@gmail.com 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