Last active
March 15, 2017 03:18
-
-
Save vmussak/380fe5c79b4a7ac43fafa6a8242802bf to your computer and use it in GitHub Desktop.
Exemplo de procedure do postgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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