2 messages in com.mysql.lists.win32Re: Quote problem with TextPad.| From | Sent On | Attachments |
|---|---|---|
| Stephen Salbod | 01 Jan 2006 11:32 | |
| Chris | 01 Jan 2006 12:14 |
| Subject: | Re: Quote problem with TextPad.![]() |
|---|---|
| From: | Chris (list...@leftbrained.org) |
| Date: | 01/01/2006 12:14:01 PM |
| List: | com.mysql.lists.win32 |
Stephen Salbod wrote:
CREATE TABLE 'members' (
`members` int(10) NOT NULL,
`fname` char(50) NOT NULL,
`lname` char(50) NOT NULL,
`phone` char(50) NOT NULL,
`email` char(50) NOT NULL
) TYPE=MyISAM;
INSERT INTO `members` VALUES (1, 'John', 'Doe', '1234567', 'jd...@somewhere.com');
INSERT INTO `members` VALUES (2, 'Jane', 'Doe', '8373728', 'ja...@site.com');
INSERT INTO `members` VALUES (3, 'Steve', 'Salbod', '7449373', 'ssal...@pace.edu');
INSERT INTO `members` VALUES (4, 'Santa', 'Claus', '9999999', 'san...@the-north-pole.com');
----------------------------------------------------------------------------
-------------------------------------------------------------
I used the TextPad to create a file (quotes.sql) with the above contents. When I used SOURCE to read the file into MySQL I got an error that the MEMBERS TABLE was not created. I notice that single quotes in the file appeared to be different. I looked at the file in DEBUG and found that both QUOTES on the CREATE TABLE line were HEX 60, while the pair of QUOTES on all of lines were HEX 27 and HEX60, respectively. From this, can I assume that MySQL requires both and Opening single quote (HEX 60) and a Closing single quote (HEX 27)? And second, is their a way to configure TextPad, so that it produces the correct quote pairs?
Any suggestions will be welcomed. Thank you.
MySQL uses the tick mark ( ` )* to escape database, table, and column names. It uses Single-quotes or double quotes to escape data.
Your INSERT statements look fine. The data is being escaped by single-quotes and the table name by tick marks. The CREATE TABLE statement, however, is literally creating a table named 'members' , not members. You 'd need to use the tick mark jsut like the INSERT statements.
Chris
* The tick mark is on the upper left of the American keyboard, under the tilde ( ~ ).




