Bonjour,
Je suis en train de créer un script en MYSQL (version 5.6.17).
Je viens d'avoir une erreur au début du script :
Et voici mon code, qui commence comme ça:Error 1064 (42000) at line 5 : Erreur de syntaxe près de 'BEGIN
DECLARE StartDate DATETIME;
DECLARE EndDate DATETIME;
DECLARE PreceedingOldValue INT DEFAULT 0;
DECLARE Preceedin'
J'ai suivi la documentation MYSQL mais je ne vois pas où ça coince, quelqu'un une idée ?
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 DROP FUNCTION IF EXISTS getHours; DELIMITER // CREATE FUNCTION getHours() BEGIN DECLARE StartDate DATETIME; DECLARE EndDate DATETIME; DECLARE PreceedingOldValue INT DEFAULT 0; DECLARE PreceedingNewValue INT DEFAULT 0; DECLARE CurrentTicket INT DEFAULT 0; DECLARE NbWorkingDays INT DEFAULT 0; DECLARE items_id, id, old_value, new_value, id_users INT(10); DECLARE date_mod, creation_date DATETIME; DECLARE name VARCHAR(50); DECLARE NbHours INTEGER DEFAULT 0; (...) END; // DELIMITER;
Merci.
Partager