Re: returning setof varchar

From: Richard Huxton <dev(at)archonet(dot)com>
To: Scott Schulthess <scott(at)topozone(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: returning setof varchar
Date: 2007-04-20 17:00:50
Message-ID: 4628F1C2.6080305@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-04-20 17:18:56 Re: Schema relationship diagram
Previous Message Jeff Davis 2007-04-20 16:56:54 Re: returning setof varchar