Bonjour a vous,
J'ai une erreur qui s'affiche sur ma page php, si quelqu'un pourrait m'aider.(j'arrive pas a voir ou se situe le probleme)
Voici le code source que jai mis en place:
---------- Procedure stockée
--------
Code sql : 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 CREATE proc Charger_Reporting_suspens_MetierChapitre @Date_Debut varchar(15) as DECLARE @cols VARCHAR(2000); DECLARE @query VARCHAR(4000); SELECT @cols = COALESCE(@cols + ',[' + cast(a.annee as varchar(50)) + ']','[' + cast(a.annee as varchar(50)) + ']') from (select distinct annee from sp_reporting_suspens_MetierChapitre where Date_reporting=@Date_Debut) a --select @cols SET @query = N'select (select entite_lib from sp_entite where entite_id=PivotTable.entite_id) Lib_Entite, (select chapitre_code from sp_chapitre where chapitre_id=PivotTable.chapitre_id) Lib_Chapitre, '+ @cols +' FROM ( select entite_id, chapitre_id, annee, nbr_suspens from sp_reporting_suspens_MetierChapitre where Date_reporting='+char(39)+ @Date_Debut +char(39)+ ' ) as SourceTable PIVOT ( sum(nbr_suspens) FOR annee IN ( '+ @cols +' ) ) AS PivotTable order by entite_id, chapitre_id' exec (@query) go
Appel php
---- Message d'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 $date_auj = date("d/m/Y"); $proc = mssql_init("Charger_Reporting_suspens_MetierChapitre", $c); mssql_bind($proc, "@Date_Debut", $date_auj, SQLVARCHAR, false, false , -1); $result = mssql_execute($proc);
Merci d'avanceWarning: mssql_execute() [function.mssql-execute]: message: Syntaxe incorrecte vers le mot clé 'FROM'. (severity 15) in C:\wamp\www\osc\inc\rep_suspens_metier_chapitre.php on line 36
Warning: mssql_execute() [function.mssql-execute]: message: Syntaxe incorrecte vers le mot clé 'as'. (severity 15) in C:\wamp\www\osc\inc\rep_suspens_metier_chapitre.php on line 36
Warning: mssql_execute() [function.mssql-execute]: stored procedure execution failed in C:\wamp\www\osc\inc\rep_suspens_metier_chapitre.php on line 36
Partager