
syntaxis error
Publicado por Monsse (1 intervención) el 25/09/2013 18:08:52
Estoy creando este procedimiento y necesito 3 cursores apenas abri el primero y ya tengo error , al declarar la variable del cursor, si quito esa linea me lo pone al declarar el cursor , me pueden ayudar porfas
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
DELIMITER //
CREATE PROCEDURE bookup.subscriptions_sp (fecha_repartir date)
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS bookup.tmp_subscriptions
( Ruta INT(11) NOT NULL,
Repartidor INT(11) NOT NULL,
Publicacion INT(11) NOT NUll,
Tipo_Suscripcion INT(11) NOT NULL,
Tipo_Aviso INT(11) NOT NULL,
Vigentes_Pagadas DECIMAL(15,2) NOT NULL DEFAULT 0,
Vigentes_Cortesia DECIMAL(15,2) NOT NULL DEFAULT 0,
Altas DECIMAL(15,2) NOT NULL DEFAULT 0,
Bajas DECIMAL(15,2) NOT NULL DEFAULT 0,
Vigentes_Pagadas_Ant DECIMAL(15,2) NOT NULL DEFAULT 0,
Vigentes_Cortesia_Ant DECIMAL(15,2) NOT NULL DEFAULT 0
);
declare repartidor_id int(11); ##Aqui me marca error syntax unexpected declare_sym
DECLARE repartidor CURSOR FOR
SELECT id from bookup.people where is_delivery= 1;
OPEN repartidor;
FETCH repartidor INTO repartidor_id;
CLOSE repartidor;
END
//
Valora esta pregunta


0