Re: returning setof varchar - Mailing list pgsql-general

From Richard Huxton
Subject Re: returning setof varchar
Date
Msg-id 4628F1C2.6080305@archonet.com
Whole thread Raw
In response to returning setof varchar  ("Scott Schulthess" <scott@topozone.com>)
List pgsql-general
Scott Schulthess wrote:
> How do I get this to work?

> for r in SELECT distinct(substring(drgtitle, 1, 1)) as text from
> stockdrgmeta where state ilike  '%' || $1 || '%'

>
> loop variable of loop over rows must be record or row variable at or
> near "LOOP" at character 218


DECLARE
    r RECORD;
BEGIN
    FOR r IN ...
        RETURN NEXT r.text

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: returning setof varchar
Next
From: "A. Kretschmer"
Date:
Subject: Re: Schema relationship diagram