RunSQL-MySQL: NULL values when importing data

Hello!

I’m using RunSQL with some imported schema and data configurations. But I’m finding that the NULL values are not properly loaded into de database.

For example, for this table:

CREATE TABLE empleado (
codigo_empleado INTEGER NOT NULL,
nombre VARCHAR(50) NOT NULL,
apellido1 VARCHAR(50) NOT NULL,
apellido2 VARCHAR(50) DEFAULT NULL,
extension VARCHAR(10) NOT NULL,
email VARCHAR(100) NOT NULL,
codigo_oficina VARCHAR(10) NOT NULL,
codigo_jefe INTEGER DEFAULT NULL,
puesto VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (codigo_empleado),
FOREIGN KEY (codigo_oficina) REFERENCES oficina (codigo_oficina),
FOREIGN KEY (codigo_jefe) REFERENCES empleado (codigo_empleado)
);

When the following insert is done, in which the codigo_jefe value is NULL…

INSERT INTO empleado VALUES (1,‘Marcos’,‘Magaña’,‘Perez’,‘3897’,‘marcos@jardineria.es’,‘TAL-ES’,NULL,‘Director General’);

It results in this:

And it brings the following error when trying to execute any query (no matter if it’s in that table or another one):
image

Of course, I have the chance to fix the data directly in the data panel. But that one is not the only NULL data wrongly added to whole schema tables.
image
Then, another wrong NULL value errors arise in another tables. Moreover, if the field is typed as VARCHAR, the NULL is considered as a string field value “null”, so it’s not so good when I need that value as NULL and not as “null”.

I also tried to modify the script (by changing NULL by null, ‘’, (null)), but I didn’t manage to make it work.
Is there something else that I should try from my side? Or is it something to be fixed by the Team?

Thanks a lot for your support and for this great RunSQL tool!

BR,
Luis

1 Like