On Freitag, 29. Juli 2011, woow wrote:
> I have following function expectation is I want to return the
> items in array
> SELECT INTO rolelist role_id FROM roles WHERE role_type =
> $1; RETURN rolelist;
Hi,
you've to use array_agg:
SELECT INTO rolelist array_agg(role_id) FROM roles
I have following function expectation is I want to return the items in array
soI could call this from another function where I could traverse through
the each array element
CREATE OR REPLACE FUNCTION get_role_id_list_for_type(INTEGER)
RETURNS INTEGER[] AS $$
DECLARE
rolelis