Skip site navigation (1) Skip section navigation (2)

Iterating over an varchar array?

From: "Marcos Iuato" <iuato(at)samurai(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Iterating over an varchar array?
Date: 2004-05-25 16:42:24
Message-ID: 2851.192.168.0.251.1085503344.squirrel@mail.samurai.com.br (view raw or flat)
Thread:
Lists: pgsql-general
I am trying to iterate over an varchar array using plpgsql but i get the
this error:

Error: missing .. at the end of SQL expression

My Table:

TABLE1(
Cars VARCHAR[]
)

My Code

Declare
 mycars varchar[];
 car varchar;
Begin
 For car in SELECT cars from table1 LOOP
   RAISE Notice "CAR: %", car
 END Loop;
END;

Resume, i have a column with a list of varchar type and i would like to
iterate over this array, is this possible?

Thanks,

Responses

pgsql-general by date

Next:From: Leandro Guimaraens Faria Corsetti DutraDate: 2004-05-25 17:35:52
Subject: Re: Ingres to be released as open source
Previous:From: Tom LaneDate: 2004-05-25 15:07:51
Subject: Re: restore from a pg_dumpall file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group