Reputation: 95
I've already successfully created a Sequence for the criminal_id column in the criminals table, but when I try to insert a new row, I get a "column not allowed" error. Here's the statement I run:
INSERT INTO criminals (criminal_id, last, first)
VALUES (criminals_criminal_id_seq.NEXTVAL, Capps, Johnny);
The error message I get back says my error is in the second line, and states: "column not allowed here." What am I doing wrong?
Upvotes: 0
Views: 256
Reputation: 7870
You missed some quotes, otherwise it thought those unquoted are column names, thus that error message:
INSERT INTO criminals (criminal_id, last, first)
VALUES (criminals_criminal_id_seq.NEXTVAL, 'Capps', 'Johnny');
Upvotes: 1