Re: spaces in table/column name

2004-12-10 Thread andy thomas
On Thu, 9 Dec 2004, sharif islam wrote:

> How mysql deals with spaces in table / column name? I am also using
> mysqlcc. If I try the following in the doesn't work. Creating table
> name with spaces from mysqlcc didn't give any error. But the following
> does:
>
> INSERT INTO 'tbl name with spaces' (col1, 'col name with spaces') 
> VALUES(15,16);

It really is a bad idea to use spaces and most non-alphanumeric characters
in database, table and column names. Spaces are used as separators in
most operating systems (recent versions of Windows and MacOS excepted) and
although you may find you can create databases, tables and columns containing
spaces if you enclose them in '' or "" quotes, you will sooner or later
run into problems if you access these outside of MySQL or using MySQL
running on a different system.

If you must put in a space, why not use the '_' underscore character? This
is legal in all operating systems I know of (MS-DOS doen't like the plain
'-' hyphen, for example).

Hope this helps,

Andy

# include 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: spaces in table/column name

2004-12-10 Thread Patrick
We have always found using anything other than alphanumeric characters and
maybe an occasional underscore for clarity is a bad idea.  It will always
come back to bite you at some point.  Try not using spaces or punctuation in
table or column names and your life will be easier.  White space and
punctuation are frequently used as delimiters in other programs, os's and
applications, so when you use them in elements other than strings you often
limit the portability (i.e. import and export) of your structures.

I hope you find this information valuable.

Pat...

Patrick Sherrill
CocoNet Corporation
SW Florida's 1st ISP



- Original Message - 
From: "sharif islam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 4:07 PM
Subject: spaces in table/column name


> How mysql deals with spaces in table / column name? I am also using
> mysqlcc. If I try the following in the doesn't work. Creating table
> name with spaces from mysqlcc didn't give any error. But the following
> does:
>
> INSERT INTO 'tbl name with spaces' (col1, 'col name with spaces')
VALUES(15,16);
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: spaces in table/column name

2004-12-09 Thread gerald_clark

sharif islam wrote:
How mysql deals with spaces in table / column name? I am also using
mysqlcc. If I try the following in the doesn't work. Creating table
name with spaces from mysqlcc didn't give any error. But the following
does:
INSERT INTO 'tbl name with spaces' (col1, 'col name with spaces') VALUES(15,16);
 

This is really bad form and should be discouraged.
If you absolutely must do this, use back-ticks, not quotes, and be 
prepared for
a never ending series of headaches later.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: spaces in table/column name

2004-12-09 Thread SGreen
Behind the scenes mysqlcc wraps the both the table name with spaces and 
the column name with spaces with back-ticks (`) not single quotes(').

http://dev.mysql.com/doc/mysql/en/Legal_names.html

Try this statement instead:

INSERT INTO `tbl name with spaces` (col1, `col name with spaces`) 
VALUES(15,16);

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

sharif islam <[EMAIL PROTECTED]> wrote on 12/09/2004 04:07:42 PM:

> How mysql deals with spaces in table / column name? I am also using
> mysqlcc. If I try the following in the doesn't work. Creating table
> name with spaces from mysqlcc didn't give any error. But the following
> does:
> 
> INSERT INTO 'tbl name with spaces' (col1, 'col name with spaces') 
> VALUES(15,16);
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 


spaces in table/column name

2004-12-09 Thread sharif islam
How mysql deals with spaces in table / column name? I am also using
mysqlcc. If I try the following in the doesn't work. Creating table
name with spaces from mysqlcc didn't give any error. But the following
does:

INSERT INTO 'tbl name with spaces' (col1, 'col name with spaces') VALUES(15,16);

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]