Em 8 de setembro de 2015 15:44, Matheus Ferreira <
[email protected]> escreveu:

> Boa Tarde pessoal
>
>
>
> Gostaria de saber se é possível criar uma function que chama outras
> functions....
>
> Sei que no Oracle eu executo
>
>
>
> begin
>
> Function1;
>
> Function2;
>
> Function3;
>
> Function4;
>
> End;
>


O postgres é bem parecido:

BEGIN;
SELECT funcion_1();
SELECT funcion_2();

SELECT funcion_3();
SELECT funcion_4();
COMMIT;



Agora se a idéia é criar uma função que chama todas, tu pode fazer assim:

CREATE OR REPLACE FUNCTION *fnc_todo_mundo()*
RETURN void AS $$

BEGIN;
  SELECT function_1();
  SELECT function_2();

  SELECT function_3();
  SELECT function_4();

END;

$$ LANGUAGE 'plpgsql';

-- Depois é só chamar a função:

*SELECT fnc_todo_mundo();*



-- 
Sebastian Webber
http://swebber.me
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a