Ver Mensaje Individual
  #1  
Antiguo 20-05-2010
devric devric is offline
Registrado
 
Registrado: mar 2010
Posts: 4
Reputación: 0
devric Va por buen camino
No puedo hacer el insert

Buenas... estoy desarrollando un sistemita en delphi 7, con MySql 5.0 y Zeos para realizar la conexión.

Para economizar tiempo, estoy utilizando el componente dbnavigator para realizar la gestión de los registros. Tengo 15 tablas, a la hora de manipularlas, en 14, ningún problema, salvo en 1 en la que no puedo realizar el insert.

Cree un form nuevo, arrastre los campos(fields) de la tabla T_an_brucelo (nombre de la tabla en cuestion) desde el DataModule directamente, coloque un DBN que apunta a T_an_brucelo. Ejecuto un insert relleno algunos dbedit's y cuando ejecuto el post desde el dbnavigator, me aparece este mensaje de error (no puedo colocar links todavia)

"Proyect labrydea.exe raised exception class EZSQLException with message 'SQL Error: You have error in your SQL syntax; check the manual that corresponds your MySQL server version for the right syntax to use near '2,rb,pal,pal2,ifd,fc,ielisa,celisa,fpa,prueba,diagnostico,estado)VALUES(1,NULL'at line 1'.Process stopped. Use Step or Run continue."

Probe tambien con un boton que ejecute un Post de la tabla (en lugar de hacerlo desde el dbnavigator) y me da el mismo error, lo que me hizo pensar que en realidad, el dbn tiene algun problema al ejecutar el insert...

El código de la tabla es el siguiente:

Código SQL [-]
CREATE TABLE `brucelosis` (   `id_analisis` int(11) NOT NULL,    `id_cliente` smallint(6) DEFAULT NULL,   `id_predio` smallint(6) DEFAULT  NULL,   `id_doctor` int(11) DEFAULT NULL,   `id_individuo` int(11)  DEFAULT NULL,   `id_raza` smallint(6) DEFAULT NULL,   `id_especie`  smallint(6) DEFAULT NULL,   `id_protocolo` int(11) DEFAULT NULL,    `num_muestra` int(11) DEFAULT NULL,   `fecha` date DEFAULT NULL,   `bpa`  char(2) DEFAULT NULL,   `wright` smallint(6) DEFAULT NULL,   `2me`  smallint(6) DEFAULT NULL,   `2` char(10) DEFAULT NULL,   `rb` char(2)  DEFAULT NULL,   `pal` char(2) DEFAULT NULL,   `pal2` smallint(6) DEFAULT  NULL,   `ifd` char(2) DEFAULT NULL,   `fc` char(1) DEFAULT NULL,    `ielisa` char(1) DEFAULT NULL,   `celisa` char(1) DEFAULT NULL,   `fpa`  char(1) DEFAULT NULL,   `prueba` char(2) DEFAULT NULL,   `diagnostico`  char(1) DEFAULT NULL,   `estado` varchar(20) DEFAULT NULL,   PRIMARY KEY  (`id_analisis`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;


Algúno tiene alguna idea??

O alguien conoce algun buen generador de consultas SQL para delphi?? (tambien tengo problemas al hacer el insert directamente por consulta)

Desde ya, muchisimas gracias!!
Responder Con Cita