MySQL Forums
Forum List  »  Newbie

Re: why won't this insert work?
Posted by: Rick James
Date: February 23, 2009 11:52PM

Plan A: Include the fields you are setting:
INSERT INTO participant (surname, firstname, ...)
  VALUES ('Washington','George', ...);

Plan B: Use NULL for the id:
INSERT INTO participant
  VALUES (NULL, 'Washington','George', ...);

Plan A is preferred because you might some day add/modify the columns. Then the list of columns might change or be rearranged; 'George' might end up in the 'street'.

Options: ReplyQuote


Subject
Written By
Posted
February 23, 2009 09:34PM
Re: why won't this insert work?
February 23, 2009 11:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.