Skip to content
Advertisement

“Column not allowed here” error in INSERT statement-ORA-00984

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;

Advertisement

Answer

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;
/
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement