Club Delphi  
    Paypal   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
  #2  
Antiguo 29-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 14
teecweb Va por buen camino
Error al ejecutar una consulta en mysql

Holas.. eh ejecutado una consulta en mysql remotamente y me bota el error 1024 pero al ejecutar localmente me corre normalmente le envio el codigo original..abajo le envio un zip mostrando la imagen..gracias por sus respuestas

Código SQL [-]


DELIMITER $$
CREATE DEFINER=`usermysql`@`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, 3 visitas)
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 00:09:33.


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