Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/03/2010, 10:46
Avatar de gnzsoloyo
gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 16 años, 5 meses
Puntos: 2658
Respuesta: Error en store procedure

Este sería el código (a cargar usando el MySQL Query Browser, por ejemplo):
Código MySQL:
Ver original
  1. DELIMITER $$
  2.  
  3. DROP PROCEDURE IF EXISTS `sp_grid_perfil` $$
  4. CREATE PROCEDURE `sp_grid_perfil`(in inicio int, in limite int)
  5.   PREPARE sent FROM 'SELECT * FROM uno LIMIT ?, ?';
  6.   IF inicio <limite THEN
  7.     SET @a = inicio;
  8.     SET @b = limite;
  9.   ELSE
  10.     SET @b = inicio;
  11.     SET @a = limite;
  12.   END IF;
  13.   EXECUTE sent USING @a, @b;
  14.   DEALLOCATE PREPARE sent;
  15. END$$
  16. DELIMITER ;
__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)