Bonjour afin d'eviter de taper un trés grand nombre de requéte je voudrai creer ma requete en concatenant differente chaine de caractéres afin de construire ma requéte. Voila ma procedure:
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
 
  /* selectionner les interventions */
DELIMITER //
Create procedure selectinter(date_actuelle date,utilisateur integer,future boolean,passee boolean,fait boolean,pause boolean,cours boolean,faire boolean,moi boolean)
BEGIN
declare tut text;
if not future then set tut='date_intervention<date_actuelle' ;
end if;
if not passee then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
	set tut=concat(tut,'date_intervention>date_actuelle') ;
end if;
if not fait then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
	set tut=concat(tut,'id_statut!=1') ;
end if;
if not pause then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
	set tut=concat(tut,'id_statut!=2') ;
end if;
if not cours then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
	set tut=concat(tut,'id_statut!=3') ;
end if;
if not faire then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
 	set tut=concat(tut,'id_statut!=4') ;
end if;
if moi then
	if tut!='' then set tut=concat(tut,' and ');
	end if;
	set tut=concat(tut,'uti_id_utilisateur=utilisateur') ;
end if;
select * from intervention where select(tut);
end;
//
 
DELIMITER ;
la chaine tut est bien la bonne, je n'ai pas d'erreur mais quand j'essaye de l'executer il m'affiche le nom des colonnes mais pas de résultat!

A mon avis l'erreur est vers le select (tut) a la fin mais je ne voit pas comment faire!

Merci de votre aide!