Re: Removing Context Messages

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема Re: Removing Context Messages
Дата
Msg-id 3e592836-e3ae-473e-9441-29c583d4d4d8@u10g2000prn.googlegroups.com
обсуждение исходный текст
Ответ на Removing Context Messages  ("Fernando Hevia" <fhevia@gmail.com>)
Ответы Re: Removing Context Messages  ("Fernando Hevia" <fhevia@gmail.com>)
Список pgadmin-support
On Apr 8, 3:01 pm, fhe...@gmail.com ("Fernando Hevia") wrote:
(...)
> --- Function declaration follows in case it helps ---
> CREATE OR REPLACE FUNCTION f_inner(p_client numeric(10)) RETURNS void AS
> $BODY$
> DECLARE
>   r_clients clientes%ROWTYPE;
> BEGIN
>   SELECT * INTO r_clients FROM clientes WHERE id_cliente = p_client;
>   RAISE NOTICE 'f_inner: % = [%]', p_client, r_clients.apellido;
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
>
> CREATE OR REPLACE FUNCTION f_outer() RETURNS void AS
> $BODY$
> DECLARE
>   r_clients clientes%ROWTYPE;
> BEGIN
>   FOR r_clients IN SELECT * FROM CLIENTES
>   LOOP
>     RAISE NOTICE 'f_outer: %', r_clients.id_cliente;
>     PERFORM f_inner(r_clients.id_cliente);
>   END LOOP;
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;

Regardless of your request about silencing context messages (did not
look into that): maybe SQL along these lines would do the job for you?

select id_cliente, array_to_string(ARRAY(SELECT apellido from clientes
c0 WHERE c0.id_cliente = c.id_cliente), E'\n')
from clientes c
group by id_cliente


Regards
Erwin


В списке pgadmin-support по дате отправления:

Предыдущее
От: Erwin Brandstetter
Дата:
Сообщение: Re: Grant RULE removed in pg 8.2
Следующее
От: "Fernando Hevia"
Дата:
Сообщение: Re: Removing Context Messages