Hi all,
Does anyone have any advice on using application code with a
refcursor? This is a follow up to my "is there a safe-ish way to
execute arbitrary sql" ? Now that I have way to execute my arbitrary
sql, I need to generate an html table with the arbitrary result inside
some PHP (or whatever), so I need to loop over the results of the
cursor (or do some weird return setof magic which I just figured out).
Sorry to ask here, but I think it is more likely that the readers will
even know what a refcursor is than on a massive php email list.
Here is what I have working in psql:
select query_table_data('select * from mkn_data.datatable_00013', 'boobear');
query_table_data
------------------
boobear
(1 row)
mkn=# FETCH FORWARD ALL FROM boobear;
col1 | col2
-------+------
bob | 34
alice | 32
(2 rows)
Now I need something that says
$curs.fetchall()