Re: puzzled by SELECT INTO - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: puzzled by SELECT INTO
Date
Msg-id a55915760710301357s47bf6ecbyb6bd8de675b903cd@mail.gmail.com
Whole thread Raw
In response to puzzled by SELECT INTO  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Responses Re: puzzled by SELECT INTO
List pgsql-sql
On 10/30/07, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
> Wreird enough to me, need some advice plz!

CREATE OR REPLACE FUNCTION READ_WORDS(BIGINT, INT[])
RETURNS VARCHAR
AS
$$ DECLARE   RETURNVALUE VARCHAR; BEGIN   SELECT ARRAY_TO_STRING(ARRAY(     SELECT WORD     FROM WORDS WHERE PAGE_ID=$1
   AND WORD_POSITION = ANY ($2)   ), ' ') INTO RETURNVALUE;   RETURN RETURNVALUE; END;
 
$$ LANGUAGE PLPGSQL;

SELECT READ_WORDS(99466, '{2994,2995,2996}');

See:
http://www.postgresql.org/docs/8.2/static/arrays.html


pgsql-sql by date:

Previous
From: "Fernando Hevia"
Date:
Subject: Perfomance benefit using Min() against order by & limit 1?
Next
From: "Fernando Hevia"
Date:
Subject: Re: Perfomance benefit using Min() against order by & limit 1?