table creation issue
not sure why but it keeps telling me i have an error at "when...."
i can't find anything that tells me when is a reserved word so i don't really know what's the issue here. any help would be appreciated.
CREATE TABLE apphist(
appindex int unsigned NOT NULL auto_increment PRIMARY KEY,
approver varchar(15) NOT NULL,
member varchar(15) NOT NULL,
item tinyint(1) NOT NULL,
reason tinytext,
ok tinyint(1) NOT NULL,
when datetime default '0000-00-00 00:00:00' NOT NULL,
KEY approver (approver),
KEY member (member),
KEY item (item),
KEY ok (ok),
KEY when (when)
) TYPE=MyISAM;
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Busy posted this at 07:45 — 31st December 2003.
He has: 6,151 posts
Joined: May 2001
I think when and ok are reserved words (could be wrong)
try adding is_ok and did_when or something and see if the errors go away
Mark Hensler posted this at 15:18 — 31st December 2003.
He has: 4,048 posts
Joined: Aug 2000
http://www.mysql.com/doc/en/Reserved_words.html
"WHEN" is on the list. Though, I don't remember ever using it.
m3rajk posted this at 01:54 — 1st January 2004.
They have: 461 posts
Joined: Jul 2003
the books i have have mentions of reseved words scattered around. it's likely i missed it while looking for them, but i like that page MUCH better. already bookmarked and filed it for the future =o)
i didn't think of the possibility that i might havemissed one since they're scattered. that's why i came here first. i thought itwas something inthe declaration that i was overlooking and was too minor for me to see since i'm "too close to the code"
thanx again for the reserved word page =o)
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
antoshka posted this at 05:56 — 23rd January 2004.
They have: 30 posts
Joined: Aug 2003
this will work.
CREATE TABLE apphist(
appindex int unsigned NOT NULL auto_increment PRIMARY KEY,
approver varchar(15) NOT NULL,
member varchar(15) NOT NULL,
item tinyint(1) NOT NULL,
reason tinytext,
ok tinyint(1) NOT NULL,
`when` datetime default '0000-00-00 00:00:00' NOT NULL,
KEY approver (approver),
KEY member (member),
KEY item (item),
KEY ok (ok),
KEY `when` (`when`)
) TYPE=MyISAM;
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.