Quote problem with TextPad.
am 01.01.2006 20:32:31 von Stephen Salbod
--Boundary_(ID_YrpKmM3WrVBKi2l2QuQVeg)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
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',
'jdoe@somewhere.com');
INSERT INTO `members` VALUES (2, 'Jane', 'Doe', '8373728',
'jane@site.com');
INSERT INTO `members` VALUES (3, 'Steve', 'Salbod', '7449373',
'ssalbod@pace.edu');
INSERT INTO `members` VALUES (4, 'Santa', 'Claus', '9999999',
'santa@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.
--Boundary_(ID_YrpKmM3WrVBKi2l2QuQVeg)--
Re: Quote problem with TextPad.
am 01.01.2006 21:14:24 von Chris
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',
>'jdoe@somewhere.com');
>
>INSERT INTO `members` VALUES (2, 'Jane', 'Doe', '8373728',
>'jane@site.com');
>
>INSERT INTO `members` VALUES (3, 'Steve', 'Salbod', '7449373',
>'ssalbod@pace.edu');
>
>INSERT INTO `members` VALUES (4, 'Santa', 'Claus', '9999999',
>'santa@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 ( ~ ).
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org