Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. procedure check_name(s_name in varchar2,err out integer)is
  2. begin
  3. if (s_name is null) or (s_name = '') or
  4. rtrim(s_name,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') is not null then
  5. err:=1;
  6. else
  7. err:=0;
  8. end if;
  9. end;
  10. procedure check_surname(surname in varchar2,err out integer)is
  11. begin
  12. if (surname is null) or (surname = '') or
  13. rtrim(surname,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') is not null then
  14. err:=1;
  15. else
  16.  
  17. err:=0;
  18. end if;
  19.  
  20. end;
  21. procedure check_year(birth in date,err out integer) is
  22. diff number;
  23. begin
  24. if birth is not null then
  25. diff:=months_between( sysdate, birth ) / 12;
  26. if diff<18 then
  27. err:=1;
  28. elsif diff>102 then
  29. err:=1;
  30. else
  31. err:=0;
  32. end if;
  33. else
  34. err:=1;
  35. end if;
  36. end;
  37. procedure check_iin(iiin varchar2,err out integer)is
  38. ini integer;
  39. begin
  40. if rtrim(iiin,'0123456789') is not null or length(iiin)<>12 then
  41. err:=2;
  42. return ;
  43. end if;
  44. select count(t.id) into ini from test_client t where t.iin = iiin;
  45. if ini=0 then
  46. err:=0;
  47. else
  48. err:=1;
  49. end if;
  50. dbms_output.put_line('ini'||ini);
  51. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement