![]() | |
#1
| |||
| |||
|
|
Field | Type | Null | Key | Default | Extra | |
|
MeetingID | int(10) unsigned | NO | PRI | NULL | auto_increment | Category | varchar(80) | NO | PRI | NULL | Location | varchar(80) | NO | | NULL | MeetingDT | date | NO | | NULL | MeetingTM | time | NO | | NULL | DurationMinutes | int(11) | YES | | NULL | Topic | varchar(80) | NO | PRI | NULL | Speaker | varchar(32) | YES | | NULL | EventLink | varchar(128) | YES | | NULL | Description | varchar(256) | YES | | NULL | +-----------------+------------------+------+-----+--------- |
#2
| |||
| |||
|
|
I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' |
#3
| |||
| |||
|
|
On 11/10/2011 2:55 PM, SpreadTooThin wrote: I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> *INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' Ummmm.... look at the quotes around that string in your SQL command.... |
#4
| |||
| |||
|
|
On Nov 10, 1:11 pm, Doug Miller<doug_at_milmacdot... (AT) example (DOT) com wrote: On 11/10/2011 2:55 PM, SpreadTooThin wrote: I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' Ummmm.... look at the quotes around that string in your SQL command.... It's a date. Should it have been "2011-12-01"? |
#5
| |||
| |||
|
|
I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. Can you help? mysql> describe Schedule; +-----------------+------------------+------+-----+--------- +----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+------------------+------+-----+--------- +----------------+ | MeetingID | int(10) unsigned | NO | PRI | NULL | auto_increment | | Category | varchar(80) | NO | PRI | NULL | | | Location | varchar(80) | NO | | NULL | | | MeetingDT | date | NO | | NULL | | | MeetingTM | time | NO | | NULL | | | DurationMinutes | int(11) | YES | | NULL | | | Topic | varchar(80) | NO | PRI | NULL | | | Speaker | varchar(32) | YES | | NULL | | | EventLink | varchar(128) | YES | | NULL | | | Description | varchar(256) | YES | | NULL | | +-----------------+------------------+------+-----+--------- +----------------+ 10 rows in set (0.01 sec) mysql> INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' |
#6
| |||
| |||
|
|
And the same goes for double quotes: use single quotes instead. Double quotes are used to quote identifiers in ANSI-SQL mode. |
#7
| |||
| |||
|
|
On Nov 10, 1:11 pm, Doug Miller<doug_at_milmacdot... (AT) example (DOT) com wrote: On 11/10/2011 2:55 PM, SpreadTooThin wrote: I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' Ummmm.... look at the quotes around that string in your SQL command.... It's a date. Should it have been "2011-12-01"? |
#8
| |||
| |||
|
|
On 11/10/2011 5:11 PM, SpreadTooThin wrote: On Nov 10, 1:11 pm, Doug Miller<doug_at_milmacdot... (AT) example (DOT) com wrote: On 11/10/2011 2:55 PM, SpreadTooThin wrote: I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> * *INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' Ummmm.... look at the quotes around that string in your SQL command..... It's a date. *Should it have been "2011-12-01"? Doesn't matter whether it's a date, or anything else -- NEVER use backticks around data values. Yes, "2011-12-01" would work. Using single quotes for everything would be better. But not backticks. Backticks are not quotes. This is a backtick: ` (which you used) This is a single quote: ' |
#9
| |||
| |||
|
|
On Nov 11, 6:01 am, Doug Miller<doug_at_milmacdot... (AT) example (DOT) com wrote: On 11/10/2011 5:11 PM, SpreadTooThin wrote: On Nov 10, 1:11 pm, Doug Miller<doug_at_milmacdot... (AT) example (DOT) com wrote: On 11/10/2011 2:55 PM, SpreadTooThin wrote: I'm trying to add a row to my table but I'm getting an SQL sytax error that I don't understand. [...] mysql> INSERT INTO Schedule (Category,Location,MeetingDT,MeetingTM,DurationMin utes,Topic,Speaker,EventLink,Description) VALUES ("Rounds","No Location Set",`2011-12-01`,"12:00", 60,"DICOM","Brian OBrien","http://nema.medical.org","A Discussion of the DICOM standard."); ERROR 1054 (42S22): Unknown column '2011-12-01' in 'field list' Ummmm.... look at the quotes around that string in your SQL command.... It's a date. Should it have been "2011-12-01"? Doesn't matter whether it's a date, or anything else -- NEVER use backticks around data values. Yes, "2011-12-01" would work. Using single quotes for everything would be better. But not backticks. Backticks are not quotes. This is a backtick: ` (which you used) This is a single quote: ' So if a value has a back tic ` in it does it need to be escaped? |
![]() |
| Thread Tools | |
| Display Modes | |
| |