Arjuna Aircraft Ident.: F-MBSD | J'aime bien causer dans le vide moi
Bon, j'ai pondu ça, c'est pas top mais bon, c'est mieux que rien...
Code :
- create or replace function get_rights(v_codsoc tie.codsoc%type, v_typtie tie.typtie%type, v_sigtie tie.sigtie%type)
- return varchar2
- is
- i number;
- ret varchar2(30);
-
- a varchar2(30);
- b varchar2(30);
-
- begin
- i := 0;
- select tbl.lib2, rpad(nvl(wt_right.rights, ' '), length(tbl.lib2))
- into a, b
- from wt_right, tbl, tie
- where tie.codsoc = v_codsoc
- and tie.typtie = v_typtie
- and tie.sigtie = v_sigtie
- and tbl.codsoc = tie.codsoc
- and tbl.codtbl = '102'
- and tbl.cletbl = substr(tie.typtie || tie.famtie, 1, 6)
- and wt_right.codsoc(+) = tie.codsoc
- and wt_right.typtie(+) = tie.typtie
- and wt_right.sigtie(+) = tie.sigtie;
-
- while i < length(a)
- loop
- i := i + 1;
- if substr(b, i, 1) = ' ' then
- ret := ret || substr(a, i, 1);
- else
- ret := ret || substr(b, i, 1);
- end if;
- end loop;
-
- return ret;
- end;
|
Message édité par Arjuna le 15-05-2006 à 12:56:44
|