Appel d'une requête dans une fonction IF

vaness303 Messages postés 1 Date d'inscription lundi 25 mai 2009 Statut Membre Dernière intervention 25 mai 2009 - 25 mai 2009 à 15:34
cs_cantador Messages postés 4720 Date d'inscription dimanche 26 février 2006 Statut Modérateur Dernière intervention 31 juillet 2021 - 26 mai 2009 à 17:03
bonjour, j'ai toujours un probleme de requete que je ne comprend pas, voici mon code :

declare @rq1 int;
 
 
@rq1=SELECTDISTINCT
T_HST_POSTE.NumSalarie, T_HST_POSTE.CodePoste, T_HST_POSTE.InfoEnCours, T_COMPREQUISE_POSTE.CodePoste AS codepostereq,
T_COMPREQUISE_POSTE.Niveau, T_COMPREQUISE_POSTE.Ponderation, T_COMPREQUISE_POSTE.Code AS CodeReq,
T_COMPACQUISE.Code AS CodeAcq
FROM T_HST_POSTE INNERJOIN
T_COMPREQUISE_POSTE ON T_HST_POSTE.CodePoste = T_COMPREQUISE_POSTE.CodePoste INNERJOIN
T_COMPACQUISE ON T_HST_POSTE.NumSalarie = T_COMPACQUISE.NumSalarie
WHERE(T_HST_POSTE.InfoEnCours = '1')AND(T_COMPREQUISE_POSTE.Code NOTIN(T_COMPACQUISE.Code))SELECTDISTINCT
T_HST_POSTE.NumSalarie, T_HST_POSTE.CodePoste, T_HST_POSTE.InfoEnCours, T_COMPREQUISE_POSTE.CodePoste AS codepostereq,
T_COMPREQUISE_POSTE.Niveau, T_COMPREQUISE_POSTE.Ponderation, T_COMPREQUISE_POSTE.Code AS CodeReq,
T_COMPACQUISE.Code AS CodeAcq
FROM T_HST_POSTE INNERJOIN
T_COMPREQUISE_POSTE ON T_HST_POSTE.CodePoste = T_COMPREQUISE_POSTE.CodePoste INNERJOIN
T_COMPACQUISE ON T_HST_POSTE.NumSalarie = T_COMPACQUISE.NumSalarie
WHERE(T_HST_POSTE.InfoEnCours = '1')AND(T_COMPREQUISE_POSTE.Code NOTIN(T_COMPACQUISE.Code))
 
IF @Rq1 IS true begin ...



je travail sous sql server enterprise manager 2000 et mon probleme c'est que je n'arrive pas a faire appelle a ma requete , c'est surement ma syntaxe qui est fausse , ma requete en elle meme elle est bonne je l'ai tester mais des que je veux y faire apelle sa bloque,

merci de me donner des informations se serait sympa, bonne apres midi, ^^

2 réponses

JulioDelphi Messages postés 2226 Date d'inscription dimanche 5 octobre 2003 Statut Membre Dernière intervention 18 novembre 2010 14
25 mai 2009 à 15:48
Bonjour
Dans quel langage programmes-tu ? Ici c'est Delphi et je n'ai pas l'impression de ce "declare" et ce "if ... is true" soit du delphi.
Point 8 du règlement :
"On pense à donner le bout de code qui pose problème et à préciser le langage utilisé."

Merci à bientôt
0
cs_cantador Messages postés 4720 Date d'inscription dimanche 26 février 2006 Statut Modérateur Dernière intervention 31 juillet 2021 13
26 mai 2009 à 17:03
bonjour,

Faudrait aussi mettre la question correctement dans la TextBox..
parceque ça...
et puis hein..
ah mais...

cantador
0
Rejoignez-nous