so from this code:
from dosql import *
import cgi
import simplejson as json
def index(req, userID):
userID = cgi.escape(userID)
get = doSql()
rec =
SELECT get_progressrecord(ID)
will return a single column of type record
.
SELECT * FROM get_progressrecord(ID)
will return multiple columns (matching your out
params).
As an aside, the fact that your output fields have no names might make your function a little difficult to work with. There's also an alternative syntax for RETURNS SETOF RECORD
which I find easier:
CREATE OR REPLACE FUNCTION get_progressrecord(int)
RETURNS TABLE(
height decimal(5,2),
weight decimal(5,2),
bmi decimal(4,2),
healthStatus text,
age int,
changePercentage decimal(4,2)
) AS
...