MySQL > Generating SQL Script > DEFAULT for VarChar : syntax error (quotes missing)

Hi
I generated a SQL Script for MySQL and the DEFAULT value for VarChar gets an error
CREATE TABLE POI_PAD_Sources (
id_pad_source INT AUTO_INCREMENT NOT NULL,
code_id INT NOT NULL DEFAULT 0,
code_name VARCHAR(50) NOT NULL DEFAULT -,
PRIMARY KEY (id_pad_source)
);

Should be with quotes

code_name VARCHAR(50) NOT NULL DEFAULT "-",

It's up to you to add the quotes in the default value field. Data Modeler doesn't parse or interpret it according to the data types, so the value typed in the field is put as-is in the SQL statement.

OK, thanks for this clarification Wagner

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.