1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| SQL> create or replace procedure authid current_user
2 create_user(l_key in varchar2,
3 l_userid in varchar2,
4 l_nomprenom in varchar2,
5 l_tel in varchar2,
6 l_fax in varchar2,
7 l_site in number,
8 l_log in varchar2,
9 l_service in number,
10 l_password in varchar2,)
11 is
12
13 l_data varchar2(2000);
14 key_check_flag number;
15 l_encrypted_string varchar2(2000);
16
17 begin
18 --- the key and the input data must have a length
19
20 -- divisible by eight (the key must be exactly 8 bytes long).
21
22 l_data := rpad(l_password,(trunc(length(l_password)/8)+1)*8,chr(0));
23 key_check_flag := mod(length(l_key),8);
24 if key_check_flag != 0 then
25 raise_application_error(-20199,'clé doit être de 8 caractères de long');
26 end if;
27 -- encrypt the input string
28 dbms_obfuscation_toolkit.desencrypt
29 (input_string => l_data,
30 key_string => l_key,
31 encrypted_string => l_encrypted_string);
32 -- dbms_output.put_line('l_string encrypted: ' || l_encrypted_string);
33
34 insert into users
35 (userid, nomprenom, tel, fax, site, date_creation, createur,service,password)
36 values (lower(l_userid), upper(
37 l_nomprenom), l_tel, l_fax, l_site, sysdate, l_log,
38 l_service, l_encrypted_string);
39 end;
40 /
Avertissement : Procédure créée avec erreurs de compilation.
SQL> begin
2 create_user('titcha','marwen','11111111','66666666','www.marwen.com','aa','bb','123456789');
3 end;
4 /
create_user('titcha','marwen','11111111','66666666','www.marwen.com','aa','bb','123456789');
*
ERREUR à la ligne 2 :
ORA-06550: Ligne 2, colonne 1 :
PLS-00905: l'objet MARWEN.CREATE_USER n'est pas valide
ORA-06550: Ligne 2, colonne 1 :
PL/SQL: Statement ignored |
Partager