Bonjour,

J'en suis sûr c'est un problème tout con mais comme je suis débutant en pl-sql...

D'après le compilateur c'est un problème de syntaxe au niveau des conditions.

voilà le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
CREATE OR REPLACE PROCEDURE tableau_vertical(filtre_type varchar2, colonne_ordonne varchar2, ordre_tri varchar2) is
id_len    integer; 
type_len  integer;
nom_len   integer;
 
TYPE myrecord IS RECORD (
id   user_objects.OBJECT_ID%type,
nom  user_objects.Object_NAME%type,
type user_objects.OBJECT_TYPE%type);    
 
TYPE mytable IS TABLE OF myrecord ;
latable mytable ;		
 
begin
 
if filtre_type = '' AND colonne_ordonne = '' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects into latable;
elseif filtre_type = '' AND colonne_ordonne <> '' AND ordre_tri ='TC' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects order by colonne_ordonne ASC into latable;
elseif filtre_type = '' AND colonne_ordonne <> '' AND ordre_tri ='TD' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects order by colonne_ordonne DESC into latable;
 
elseif filtre_type <> '' AND colonne_ordonne = '' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects where OBJECT_TYPE=filtre_type into latable;
elseif filtre_type <> '' AND colonne_ordonne <> '' AND ordre_tri ='TC' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects where OBJECT_TYPE=filtre_type order by colonne_ordonne ASC into latable;
elseif filtre_type <> '' AND colonne_ordonne <> '' AND ordre_tri ='TD' then
	select OBJECT_ID,OBJECT_NAME,OBJECT_TYPE from user_objects where OBJECT_TYPE=filtre_type order by colonne_ordonne DESC into latable;
end if;
 
id_len   :=9; 
type_len :=18;
nom_len  :=25;
 
DBMS_output.put_line('+'||RPAD( '-' , id_len , '-')||'+'||RPAD( '-'   , type_len , '-')||'+'||RPAD( '-'  , nom_len , '-')||'+');
DBMS_output.put_line('|'||RPAD( 'id', id_len , ' ')||'|'||RPAD( 'type', type_len , ' ')||'|'||RPAD( 'nom', nom_len , ' ')||'|');
DBMS_output.put_line('+'||RPAD( '-' , id_len , '-')||'+'||RPAD( '-'   , type_len , '-')||'+'||RPAD( '-'  , nom_len , '-')||'+');
 
for i in latable loop
	DBMS_output.put_line('|'||RPAD( i.id, id_len , ' ')||'|'||RPAD( i.type, type_len , ' ')||'|'||RPAD( i.nom, nom_len , ' ')||'|');
end loop;
 
DBMS_output.put_line('+'||RPAD( '-' , id_len , '-')||'+'||RPAD( '-'   , type_len , '-')||'+'||RPAD( '-'  , nom_len , '-')||'+');
 
end;
Merci d'avance de toute réponse.

Ralgrana.