List:MySQL on Win32« Previous MessageNext Message »
From:Paul DuBois Date:July 9 2002 3:14am
Subject:RE: "#" in column names possible?
View as plain text  
At 16:48 -0400 7/8/02, Joachim Schmidt wrote:
>Thanks for all the hints!
>I have figured out that with some GUI tools I can execute a query like:
>ALTER TABLE t1 ADD `test2 #` varchar(10);
>but it is funny that the MYSQL Monitor generates an error. The monitor
>obviously interprets the # as the start of a command.
>Any comments on that?

Its parser isn't as good as the server's.  Try putting a ' in a /* ... */
comment sometime and see what happens.

>
>
>
>-----Original Message-----
>From: Kevin Rutledge [mailto:kevin@stripped]
>Sent: Monday, July 08, 2002 11:35 AM
>To: Joachim Schmidt
>Subject: RE: "#" in column names possible?
>
>
>I am not sure how to do what you want.  I know with SQL DB servers, it
>is a good idea not to use spaces (most don't like this anyway) and to
>use only alpha-numeric characters...
>
>Have you tried putting the table name in quotes?
>
>I just used a product called mysqlfront to add a table named "test #"
>and a field called "test #" and it worked...
>
>Mysqlfront sends SQL commands directly.  It is using quotes around the
>field (column) names...
>
>ALTER TABLE `test #` ADD `test #` TINYINT
>
>
>>  -----Original Message-----
>>  From: Joachim Schmidt [mailto:Joachim.Schmidt@stripped]
>>  Sent: Monday, July 08, 2002 8:29 AM
>>  To: Kevin Rutledge
>>  Cc: 'win32@stripped'
>>  Subject: RE: "#" in column names possible?
>>
>>
>>  Thanks for the suggestion but the result is a column named
>>  "Book". The reason that I would like to generate this "bad
>>  practice" names is that a existing complex Access based user
>>  interface db will be the front end for the mysql db. Jochen
>>
>>
>>
>>  -----Original Message-----
>>  From: Kevin Rutledge [mailto:kevin@stripped]
>>  Sent: Monday, July 08, 2002 11:23 AM
>>  To: Joachim Schmidt
>>  Subject: RE: "#" in column names possible?
>>
>>
>>  That's not a good idea, but you might try the excape character "\"
>>
>>   "Book \#"
>>
>>  BTW: spaces are a bad practice too.
>>
>>
>>  > -----Original Message-----
>>  > From: Joachim Schmidt
>>  [mailto:Joachim.Schmidt@stripped> ]
>>  > Posted At:
>>  Monday, July 08, 2002 6:57 AM
>>  > Posted To:
>>  MySQL
>>  > Conversation: "#" in column names possible?
>>  > Subject: "#" in column names possible?
>>  >
>>  >
>>  > Hi,
>>  > I would like to migrate an Access db to mysql, unfortunately
>>  > there are "#" symbols in the access column names. Since #
>>  > initiates a comment in mysql I tried `book #` but failed.
>>  > Could somebody advise if there is a way to generate a column
>>  > name like "book #" in mysql? Thanks Jochen
>>  >
>>  >
>>  ---------------------------------------------------------------------
>>  > Please check
>>  > "http://www.mysql.com/Manual_chapter/manual_to> c.html" before
>>  > posting. To request this thread, e-mail
>>  > win32-thread9175@stripped
>>  >
>>  > To unsubscribe, send a message to the address shown in the
>>  > List-Unsubscribe header of this message. If you cannot see
>>  > it, e-mail win32-unsubscribe@stripped instead.
>>  >
>>  >
>>
>
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail win32-thread9185@stripped
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail win32-unsubscribe@stripped instead.

Thread
"#" in column names possible?Joachim Schmidt8 Jul
  • Re: "#" in column names possible?Tim Endres8 Jul
    • Re: "#" in column names possible?John Hopkins9 Jul
RE: "#" in column names possible?Joachim Schmidt8 Jul
RE: "#" in column names possible?Joachim Schmidt8 Jul
  • RE: "#" in column names possible?Tim Endres8 Jul
  • RE: "#" in column names possible?Paul DuBois9 Jul
RE: "#" in column names possible?Dave Watkinson9 Jul