MySQL Forums
Forum List  »  Newbie

Re: Incorrect use of DEFAULT NULL?
Posted by: Peter Brawley
Date: March 28, 2018 08:25PM

> insert into log set timestamp=1483766635, user_id=114, machine_id=60, usage=0;

Another error in your Create Table code. `Usage` is a reserved word. When reserved words are used as database object identifiers, they have to be surrounded by backticks (`). Bad practice. Change the name of that column to an unreserved word.

Notice too an advantage of Insert...Set symtax over Insert...Values(...) syntax: it exposes such errors so they can be corrected early.



Edited 1 time(s). Last edit at 03/29/2018 11:32AM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
Re: Incorrect use of DEFAULT NULL?
March 28, 2018 08:25PM


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.