0

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?

1
  • Is this really about MySQL? Commented Oct 6, 2014 at 18:51

1 Answer 1

1

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');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.