Skip to content

Instantly share code, notes, and snippets.

@vmussak
Last active Mar 15, 2017
Embed
What would you like to do?
Exemplo de procedure do postgreSQL
CREATE OR REPLACE FUNCTION autenticacao.BuscarUsuario(pNome varchar(50), pNomeDaMae varchar(50))
RETURNS TABLE(
"id" integer,
"nome" varchar(50),
"nomeDaMae" varchar(50)
) AS $$
BEGIN
RETURN QUERY
SELECT u.id,
u.nome,
u.nomeDaMae
FROM autenticacao.usuario u
WHERE u.nome ILIKE pNome
AND u.nomeDaMae ILIKE pNomeDaMae;
END;
$$
LANGUAGE plpgsql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment