Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure check_name(s_name in varchar2,err out integer)is
- begin
- if (s_name is null) or (s_name = '') or
- rtrim(s_name,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') is not null then
- err:=1;
- else
- err:=0;
- end if;
- end;
- procedure check_surname(surname in varchar2,err out integer)is
- begin
- if (surname is null) or (surname = '') or
- rtrim(surname,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz') is not null then
- err:=1;
- else
- err:=0;
- end if;
- end;
- procedure check_year(birth in date,err out integer) is
- diff number;
- begin
- if birth is not null then
- diff:=months_between( sysdate, birth ) / 12;
- if diff<18 then
- err:=1;
- elsif diff>102 then
- err:=1;
- else
- err:=0;
- end if;
- else
- err:=1;
- end if;
- end;
- procedure check_iin(iiin varchar2,err out integer)is
- ini integer;
- begin
- if rtrim(iiin,'0123456789') is not null or length(iiin)<>12 then
- err:=2;
- return ;
- end if;
- select count(t.id) into ini from test_client t where t.iin = iiin;
- if ini=0 then
- err:=0;
- else
- err:=1;
- end if;
- dbms_output.put_line('ini'||ini);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement