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 Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
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
  #2  
Antiguo 29-03-2013
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.669
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Por favor, deja de repetir hilos, gracias.
Responder Con Cita
  #3  
Antiguo 29-03-2013
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.669
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Puedes copiar el mensaje y te ahorras de estar pegando imágenes:

Cita:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version the right syntax to use near '=1;
Responder Con Cita
  #4  
Antiguo 29-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 14
teecweb Va por buen camino
Disculpe pero no estoy repitiendo hilos..solo es una nueva pregunta..gracias
Responder Con Cita
  #5  
Antiguo 29-03-2013
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.669
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Cita:
Empezado por teecweb Ver Mensaje
Disculpe pero no estoy repitiendo hilos..solo es una nueva pregunta..gracias
Estás repìtiendo hilos. ¿Acaso no son iguales los 2 mensajes de arriba?, estaban en hilos distintos, en foros distintos, y los he unidos.
Responder Con Cita
  #6  
Antiguo 29-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 14
teecweb Va por buen camino
No me habia fijado solo que primera vez que quize enviar el primer mensaje y quize editar me salio que ya no podia editar y no salio el mensaje y por eso lo hize otra vez ..y lo mande..mi intencion no era enredar con muchos hilos ..solo mandar mi pregunta y respetar las reglas del foro..igualmente gracias..
Responder Con Cita
  #7  
Antiguo 29-03-2013
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.669
Poder: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
No hay problema, en todo caso para otra vez, puedes pedir a cualquier moderador que te lo edite. Gracias
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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 22:51: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