Re: Quote problem with TextPad.
Chris <[email protected]>
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <[email protected]> |
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', >'[email protected]'); > >INSERT INTO `members` VALUES (2, 'Jane', 'Doe', '8373728', >'[email protected]'); > >INSERT INTO `members` VALUES (3, 'Steve', 'Salbod', '7449373', >'[email protected]'); > >INSERT INTO `members` VALUES (4, 'Santa', 'Claus', '9999999', >'[email protected]'); > >---------------------------------------------------------------------------- >------------------------------------------------------------- > >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 ( ~ ). -- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/[email protected]