Background
Creating a wrapper function for a SQL statement.
Problem
A function returns 1 row, whereas the query upon which the function is based returns 100+ rows. The parameter values are identical:
SELECT * FROM as_rpt.tasc_fsa( 'ABC', '2010-01-01'::date, '2011-01-01'::date );
The tasc_fsa
function is a SELECT statement with a few table joins; the function language is 'sql' rather than 'plpgsql'.
Question
What reasons would a function return a single row yet the exact same query that the function uses, when not called via the function, correctly returns over 100 rows?
Any ideas would be most helpful.
Thank you!