Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing "default" as a value

Status
Not open for further replies.

solepixel

Programmer
May 30, 2007
111
US
I'm using SQLYog to manage the data in my MySQL table and I'm trying to use the word "default" as a value in a field and sometimes I get the results I want, and other times I don't. I have tried entering "`default`" as the value, but it stores the actual "`" characters, not resulting in the output I am expecting. If i try "default" it doesn't retain the value. Is there a trick or setting I must set before this will work?
 
Not sure if this is what you're looking for, but if you have a column's default value set, like, for example: ColumnName CHAR(100) NOT NULL DEFAULT 'omglol' -- the default value will only be used if you insert a null (or nothing) to this column. Anything other than null will be entered into the column.
 
I got this figured out. I wasn't putting the "`" characters in the right spot in the INSERT statement. It works now. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top