mysql - erro #1064 - You have an error in your SQL syntax -
i can't create table.
this code:
drop table if exists `monitoreos`; create table `monitoreos` ( `id` integer not null auto_increment default null, `fecha` varchar null default null, `id_cliente` integer null default null, `id_vehiculo` integer null default null, `posicion` integer null default null, `numero_serie` integer null default null, `numero_alterno` integer null default null, `profundidad_inicial` varchar null default null, `horometro_actual` varchar null default null, `profundidad_actual_exterior` varchar null default null, `profundidad_actual_interior` varchar null default null, primary key (`id`) );
and error:
1064 - have error in sql syntax; check manual corresponds mariadb server version right syntax use near 'null default null, `id_cliente` integer null default null, `id_vehiculo` i' @ line 3
nullable , default null
defaults, can remove them.
more importantly, need length varchar
fields. following works:
create table `monitoreos` ( `id` integer not null auto_increment , `fecha` varchar(255), `id_cliente` integer, `id_vehiculo` integer, `posicion` integer, `numero_serie` integer, `numero_alterno` integer, `profundidad_inicial` varchar(255), `horometro_actual` varchar(255), `profundidad_actual_exterior` varchar(255), `profundidad_actual_interior` varchar(255), primary key (`id`) );
here sql fiddle.
Comments
Post a Comment