Diagnosing simple problems with "create table"
Posted by:
David Karr
Date: March 08, 2017 01:09PM
I'm trying to create a couple of simple tables. I could use some help with the specific errors I'm getting, but I'd also like to know if it's possible for mysql to give me better information about the error I'm getting.
My "createTables.sql" script is pretty simple:
--------------
use uslmonitordb;
drop table if exists service_threshold;
drop table if exists notification;
create table service_threshold (id int not null auto_increment primary key,
service_name varchar not null unique,
yellow_err_threshold numeric not null,
red_err_threshold numeric not null);
create table notification (id int not null auto_increment primary key,
service_threshold_fk int not null references service_threshold(id),
address varchar not null);
-------------
When I try to pipe this file, I get this:
------------------
ERROR 1064 (42000) at line 6: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not null unique,
yellow_err_threshold numeric not null,
red_err_' at line 2
----------------
Line 6 is the start of the first "create table". I have no idea what "line 2" refers to.
Is there some way to get better diagnostics for this?
Subject
Written By
Posted
Diagnosing simple problems with "create table"
March 08, 2017 01:09PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.