Advertisement
Guest User

Auth. funkcija

a guest
Sep 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. create or replace function my_app_auth (
  2. p_username in varchar2
  3. ,p_password in varchar2
  4. ) return boolean is
  5. v_ret boolean := false;
  6. v_count pls_integer := 0;
  7. begin
  8. if p_username is not null and p_password is not null then
  9. select count(*)
  10. into v_count
  11. from app_users
  12. where username = p_username
  13. and password = p_password;
  14. end if;
  15.  
  16. v_ret := v_count > 0;
  17.  
  18. return v_ret;
  19.  
  20. exception
  21. when others then
  22. -- log error...
  23. return false;
  24. end my_app_auth;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement