Re: Functions
От | Nick Jones |
---|---|
Тема | Re: Functions |
Дата | |
Msg-id | be082070050531115223fd0151@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Functions
|
Список | pgsql-novice |
Aww, I was really close :) ... thanks, that works. I believe I understand it now :) Do you normally write functions in plpgsql or a different language (sql, perl, c)? I ask so I should know where to focus my learning.
Thanks,
Nick
--
Thanks,
Nick
Thanks,
Nick
On 5/31/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Nick Jones <neckjonez@gmail.com> writes:
> CREATE FUNCTION test2(VARCHAR) RETURNS SETOF TEXT AS
> '
> DECLARE
> r record;
> BEGIN
> FOR r IN
> select router_name from router where router_name ~ $1
> LOOP
> RETURN NEXT r;
> END LOOP;
> RETURN;
> END;
> ' LANGUAGE 'plpgsql';
Close, but you want "RETURN NEXT r.router_name". r is a record
potentially containing several fields, you have to say which you
want.
regards, tom lane
--
Thanks,
Nick
В списке pgsql-novice по дате отправления: