Search Postgresql Archives
How to read refcursor column's using string column name?
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Subject
: How to read refcursor column's using string column name?
From
: inspector morse <
inspectormorse86@xxxxxxxxx
>
Date
: Tue, 10 Mar 2015 15:56:58 -0400
How do I access a cursor's column using a string column?
Example:
CREATE FUNCTION write_html_select(items cursor, data_value_field text, data_text_field text)
AS
$$
DECLARE r RECORD;
html TEXT;
BEGIN
FOR r in items LOOP
html = "<option value=" || r[data_value_field] || "/>";
END LOOP;
RETURN html;
END;
$$
LANGUAGE plpgsql;
As you can see, I want to access RECORD r's columns by a STRING column name value (data_value_field etc)....is there anyway to do this?
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Follow-Ups
:
Re: How to read refcursor column's using string column name?
From:
Pavel Stehule
Prev by Date:
Re: Strange security issue with Superuser access
Next by Date:
Re: How to read refcursor column's using string column name?
Previous by thread:
Column is a computation
Next by thread:
Re: How to read refcursor column's using string column name?
Index(es):
Date
Thread
[Index of Archives]
[Postgresql Jobs]
[Postgresql Admin]
[Postgresql Performance]
[Linux Clusters]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Books]
[PHP Databases]
[Postgresql & PHP]
[Yosemite]