Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6 | Andrea | 1 | create or replace procedure DELETE_UTENTE(user_name varchar2) is |
2 | |||
3 | |||
4 | w_cod_profilo NUMBER; |
||
5 | |||
6 | CURSOR curruoli IS |
||
7 | select cod_profilo_u from WS_RUOLI |
||
8 | where username = user_name; |
||
9 | begin |
||
10 | |||
11 | OPEN curruoli; |
||
12 | |||
13 | LOOP |
||
14 | FETCH curruoli INTO w_cod_profilo; |
||
15 | EXIT WHEN curruoli%NOTFOUND; |
||
16 | |||
17 | delete from WS_ABILITAZIONI |
||
18 | where cod_profilo_u = w_cod_profilo; |
||
19 | |||
20 | delete from WS_RUOLI a |
||
21 | where a.cod_profilo_u = w_cod_profilo; |
||
22 | |||
23 | delete from WS_PROFILI_UTENTE |
||
24 | where cod_profilo_u = w_cod_profilo; |
||
25 | |||
26 | END LOOP; |
||
27 | |||
28 | CLOSE curruoli; |
||
29 | -- inserisco l'abilitazione |
||
30 | delete from ws_cross_enti_utenti where username = user_name; |
||
31 | delete from ws_utenti where username = user_name; |
||
32 | commit; |
||
33 | |||
34 | |||
35 | exception |
||
36 | when others then |
||
37 | dbms_output.put_line('ERR INS utente '|| sqlcode ||' '||sqlerrm); |
||
38 | rollback; |
||
39 | |||
40 | end DELETE_UTENTE; |
||
41 | / |
||
42 |