Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > MySQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 29-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 12
teecweb Va por buen camino
Problema con este function en mysql

Tengo una consulta que al ejecutra en el servidor me ocurre este error
me sale el error de mysql 1024..lo que me parece ma extraño al ejecutar localmente me ejecuta normalmente ..gracias por tu respuesta

Código SQL [-]
CREATE DEFINER=`root`@`localhost` FUNCTION `RomanToInteger`(
  `xstrRoman` varchar(4)
) RETURNS int(11)
BEGIN        
   DECLARE xi INT;
   DECLARE xstrCharacther CHAR(30);
   DECLARE xintResult INT;
   DECLARE xintNewValue INT;
   DECLARE xintOldValue INT;

   SET xstrRoman = UPPER(xstrRoman);
   SET xintOldValue = 1000;
   SET xintNewValue = 0;
   SET xintResult = 0;
   SET xi=1;  

   WHILE (xi<= length(xstrRoman)) DO
     SET xstrCharacther = SUBSTRING(xstrRoman, xi, 1);    

     CASE xstrCharacther
      WHEN 'I' THEN SET xintNewValue = 1;
      WHEN 'V' THEN SET xintNewValue = 5;
      WHEN 'X' THEN SET xintNewValue = 10;
      WHEN 'L' THEN SET xintNewValue = 50;
      WHEN 'C' THEN SET xintNewValue = 100;
      WHEN 'D' THEN SET xintNewValue = 500;
      WHEN 'M' THEN SET xintNewValue = 1000;
     END CASE;
  
    IF xintNewValue > xintOldValue THEN
      SET xintResult = xintResult + xintNewValue - 2 * xintOldValue;
    ELSE
      SET xintResult = xintResult + xintNewValue;
    END IF;
    SET xintOldValue = xintNewValue;
    SET xi=xi+1;
  
 END WHILE;
    Return xintResult;
END
Archivos Adjuntos
Tipo de Archivo: rar sd4.rar (15,7 KB, 0 visitas)

Última edición por teecweb fecha: 29-03-2013 a las 00:43:57.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Problema con function Pos() Anel Hernandez Varios 2 12-11-2012 19:30:27
Problema con la function date... georkis PHP 2 20-12-2010 17:33:56
Ayuda con este problema emiliano_b OOP 36 25-07-2010 03:36:27
que problema hay con este comando ElDioni SQL 5 14-07-2005 12:49:14
Ayudenme con este Error de Mysql 4.1 Dicdi MySQL 1 19-04-2005 23:27:56


La franja horaria es GMT +2. Ahora son las 21:37:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi