Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE FUNCTION public.get_id_funcionario(in_usuario VARCHAR, in_senha VARCHAR)
- RETURNS NUMERIC
- AS $$
- -- Declaracao de variavel
- DECLARE
- id_funcionario INT := 0;
- BEGIN
- SELECT staff_id INTO id_funcionario
- FROM staff
- WHERE username = in_usuario AND password = in_senha;
- RETURN id_funcionario;
- EXCEPTION
- WHEN no_data_found THEN
- RAISE EXCEPTION 'Usuário ou Senha Inválida';
- END;
- $$ LANGUAGE 'plpgsql';
- select public.get_id_funcionario('Mike', '8cb2237d0679ca88db6464eac60da96345513964');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement