1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

"INSERT" is not valid in this position, expecting EOF, ";"

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 31, 2021.

  1. Stack

    Stack Membro Participativo

    My code is having the above problem and I wonder is it the problem of version in MySQL workbench, as it shows the error in the output:

    Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO product_list VALUES ('A01','a','2019-07-08'),('A02','b' at line 7

    What I am doing is simply putting values in a simple table:

    CREATE TABLE product_list (
    product_no varchar(10) NOT NULL,
    product_name varchar(100) DEFAULT NULL,
    create_date date DEFAULT NULL,
    PRIMARY KEY (product_no)
    )
    INSERT INTO product_list VALUES
    ('A01','a','2019-07-08'),('A02','b','2019-08-07'),('A03','c','2019-08-06'),
    ('A04','d','2019-08-07'),('A05','a','2019-08-08'),('A06','b','2019-08-08'),
    ('A07','b','2019-08-08');


    I have solved the problem by splitting the CREATE table query and INSERT query by two different query files, and why does it happen? I reckoned CREATE and INSERT query could be functioned in the same query file.

    Continue reading...

Compartilhe esta Página