You have an error in your SQL syntax; check the manual that cor
fattahh
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
arth Messages postés 9374 Date d'inscription Statut Contributeur Dernière intervention -
arth Messages postés 9374 Date d'inscription Statut Contributeur Dernière intervention -
bonsoir, je cherche aussi la petite chose qui ne va pas dans ma ligne et qui me vaut ce message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER |' at line 1
Le code est le suivant:
DELIMITER |
CREATE FUNCTION CalculPrixTTC (p_price DECIMAL(10,2), p_tax DECIMAL(10,2)) RETURNS DECIMAL(10,2) DETERMINISTIC BEGIN RETURN ROUND(((p_price / 100) * p_tax), 2) + p_price; END |
CREATE PROCEDURE CleanBasketTable() DETERMINISTIC BEGIN DELETE FROM Basket WHERE DateAdded < DATE_SUB(NOW(), INTERVAL 1 DAY); END |
CREATE PROCEDURE CleanCustomerTable(IN p_nb_day INT) DETERMINISTIC BEGIN DECLARE v_id_customer INT(9) DEFAULT 0; DECLARE v_date_now TIMESTAMP; DECLARE v_date_connect TIMESTAMP; DECLARE c_end_cursor BOOLEAN DEFAULT FALSE; DECLARE c_nb_id_customer CURSOR FOR SELECT cus.ID_Customer, MAX(DateLastVisit) FROM Customer AS cus LEFT JOIN Orders AS odr ON odr.ID_Customer = cus.ID_Customer WHERE odr.ID_Customer IS NULL AND DateLastVisit != "0000-00-00 00:00:00" GROUP BY cus.ID_Customer; DECLARE CONTINUE HANDLER FOR NOT FOUND SET c_end_cursor = TRUE; DELETE FROM Customer WHERE Status = "T" AND DateAdded < DATE_SUB(NOW(), INTERVAL 1 DAY); SELECT DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL p_nb_day DAY) INTO v_date_now; OPEN c_nb_id_customer; FETCH c_nb_id_customer INTO v_id_customer, v_date_connect; WHILE (NOT c_end_cursor) DO IF (v_date_connect < v_date_now) THEN DELETE FROM Customer WHERE ID_Customer = v_id_customer; END IF; FETCH c_nb_id_customer INTO v_id_customer, v_date_connect; END WHILE; CLOSE c_nb_id_customer; END |
je vous remercie pour votre aide
FAttah
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER |' at line 1
Le code est le suivant:
DELIMITER |
CREATE FUNCTION CalculPrixTTC (p_price DECIMAL(10,2), p_tax DECIMAL(10,2)) RETURNS DECIMAL(10,2) DETERMINISTIC BEGIN RETURN ROUND(((p_price / 100) * p_tax), 2) + p_price; END |
CREATE PROCEDURE CleanBasketTable() DETERMINISTIC BEGIN DELETE FROM Basket WHERE DateAdded < DATE_SUB(NOW(), INTERVAL 1 DAY); END |
CREATE PROCEDURE CleanCustomerTable(IN p_nb_day INT) DETERMINISTIC BEGIN DECLARE v_id_customer INT(9) DEFAULT 0; DECLARE v_date_now TIMESTAMP; DECLARE v_date_connect TIMESTAMP; DECLARE c_end_cursor BOOLEAN DEFAULT FALSE; DECLARE c_nb_id_customer CURSOR FOR SELECT cus.ID_Customer, MAX(DateLastVisit) FROM Customer AS cus LEFT JOIN Orders AS odr ON odr.ID_Customer = cus.ID_Customer WHERE odr.ID_Customer IS NULL AND DateLastVisit != "0000-00-00 00:00:00" GROUP BY cus.ID_Customer; DECLARE CONTINUE HANDLER FOR NOT FOUND SET c_end_cursor = TRUE; DELETE FROM Customer WHERE Status = "T" AND DateAdded < DATE_SUB(NOW(), INTERVAL 1 DAY); SELECT DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL p_nb_day DAY) INTO v_date_now; OPEN c_nb_id_customer; FETCH c_nb_id_customer INTO v_id_customer, v_date_connect; WHILE (NOT c_end_cursor) DO IF (v_date_connect < v_date_now) THEN DELETE FROM Customer WHERE ID_Customer = v_id_customer; END IF; FETCH c_nb_id_customer INTO v_id_customer, v_date_connect; END WHILE; CLOSE c_nb_id_customer; END |
je vous remercie pour votre aide
FAttah
A voir également:
- You have an error in your SQL syntax; check the manual that cor
- Playback error reconnect in 3s (1/5) francais - Forum Box et Streaming vidéo
- Girl in the basement streaming vf - Forum Cinéma / Télé
- Check video cable ✓ - Forum Ecran
- Check disk - Guide
- In da place - Forum Mail