I have the same error as this one : "column not allowed here" error in INSERT statement .
My SQL table's structure looks like this:
CREATE TABLE login
(
login_id INTEGER PRIMARY KEY,
username varchar(150) NOT NULL,
password varchar(150) NOT NULL
);
INSERT INTO login (login_id, username, password)
VALUES ('9', 'Mukov', '1884');
INSERT INTO login (login_id, username, password)
VALUES ('10', 'Mukre', '661');
Have I done something wrong?
Edit: even with that way it doesn't work
CREATE TABLE login
(
login_id INTEGER PRIMARY KEY,
username varchar(150) NOT NULL,
password varchar(150) NOT NULL
);
BEGIN
INSERT INTO login (username, password)
VALUES ('1', 'Sukre', '1234');
INSERT INTO login (username, password)
VALUES ('2', 'Pal', '123444');
END;
CodePudding user response:
Update your insert statement as -
BEGIN
INSERT INTO login(login_id, username , password )VALUES (1,'Sukre','1234');
INSERT INTO login(login_id, username , password ) VALUES (2,'Pal','123444');
END;
/