select result into string's array

From: Alberto Asuero Arroyo <albertoasuero(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: select result into string's array
Date: 2009-10-09 07:30:43
Message-ID: 4ACEE6A3.4090901@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I need to store the result of select into an array of string:

/create or replace function search_engine.test/
/(/
/)/
/ returns integer as $$/
/declare/
/ m_array text[];/
/begin/
/ for m_array in select * from my_table loop/
/ raise notice 'valor 1: %',m_array;/
/ end loop;/
/ return 1;/
/end; $$ LANGUAGE plpgsql;/

This launch this errors:

/ERROR: array value must start with "{" or dimension information
SQL state: 22P02
Context: PL/pgSQL function "test" line 4 at FOR over SELECT rows/

Is it possible do this?? May I choose another way?

Thanks in advance

Alberto,

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2009-10-09 07:45:44 Re: select result into string's array
Previous Message Lennin Caro 2009-10-08 14:44:48 Re: Pulling additional columns with aggregate