pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gerardo Herzig <gherzig@fmed.uba.ar>
To: Rodrigo De León <rdeleonp@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: puzzled by SELECT INTO
Date: Wed, 31 Oct 2007 09:28:16 -0300
Message-ID: <472874E0.4060104@fmed.uba.ar> (raw)
In-Reply-To: <a55915760710301357s47bf6ecbyb6bd8de675b903cd@mail.gmail.com>
References: <47279757.50602@fmed.uba.ar>
	<a55915760710301357s47bf6ecbyb6bd8de675b903cd@mail.gmail.com>

Rodrigo De León wrote:

>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
>
>
>  
>
Mmmm, yes, that make perfect sense. I did 'resolve' the previous 
situation by using EXECUTE, i will try your solution now.

Gracias Rodrigo.
Gerardo



view thread (3+ messages)

Message-ID: <472874E0.4060104@fmed.uba.ar>
Permalink:  ../472874E0.4060104@fmed.uba.ar/
Also on:    postgresql.org/message-id/472874E0.4060104@fmed.uba.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gherzig@fmed.uba.ar, rdeleonp@gmail.com
  Subject: Re: puzzled by SELECT INTO
  In-Reply-To: <472874E0.4060104@fmed.uba.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox