question+comment : Re: set DEC as a column name : forbidden
Thank you Paul DuBois. I have 2 questions for you : 1-Why the error code (1064) can't lead explicitly to the syntax problem ? 2-Could you tell me how I could go directly to the relevant page ? [ Hard for you to feel like a lambda user in MySQL ] my comment : The Search the MySQL manual works when you know where is the problem. Funny that the keywords were in my question to the list : DEC column name forbidden, but did not made sens to me to query with these word. first, I tried on the error code [ ERROR 1064 (42000) ] : not understandable to me. then I tried keyword DEC(matching all of the words) 2 pages : helpless then I tried keyword list 17 pages, off topics [ from excerpt ] - Now If you ask me why I used keyword DEC instead of reserved word the answer is right in the begining of the page : http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html keyword DEC or reserved word DEC are the same !! for instance : The keyword INT is a synonym for INTEGER, and the keyword DEC is a synonym for DECIMAL. bla bla bla ... Regards. == On Tue, 30 May 2006, Paul DuBois wrote: At 15:46 +0200 5/30/06, Gilles MISSONNIER wrote: Hello I could not find the answer through the online Search the MySQL manual. I run MySQL 4.1 In the 4.1 manual, the reserved words are listed here: http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html DEC is in the list. Identifier-quoting guidance is here: http://dev.mysql.com/doc/refman/4.1/en/legal-names.html In astronomy, RA and DEC are widely used coordinate names. Then I try to add a column named DEC : mysql alter table my_table add dec float; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec float' at line 1 UPPER case lead to the same error. It seems that the reason is that DEC is a keyword standing for decimal. I do not understand why this cannot be allowed for a column name. Is there a turn around ? This is annoying ; I add to name the column as DECL which is much less meaning full in the astronomy community. thanks, =_==_==_==_==_==_= =¯==¯==¯==¯==¯==¯= Gilles Missonnier IAP - [EMAIL PROTECTED] -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com =_==_==_==_==_==_= =¯==¯==¯==¯==¯==¯= Gilles Missonnier IAP - [EMAIL PROTECTED] 01 44 32 81 36 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: question+comment : Re: set DEC as a column name : forbidden
At 17:38 +0200 5/31/06, Gilles MISSONNIER wrote: Thank you Paul DuBois. I have 2 questions for you : 1-Why the error code (1064) can't lead explicitly to the syntax problem ? I'm sorry, I don't understand the question. 2-Could you tell me how I could go directly to the relevant page ? [ Hard for you to feel like a lambda user in MySQL ] It sounds like you mean, When I have a problem, how can I instantly find the solution? I don't think I can answer that. my comment : The Search the MySQL manual works when you know where is the problem. Funny that the keywords were in my question to the list : DEC column name forbidden, but did not made sens to me to query with these word. first, I tried on the error code [ ERROR 1064 (42000) ] : not understandable to me. then I tried keyword DEC(matching all of the words) 2 pages : helpless then I tried keyword list 17 pages, off topics [ from excerpt ] - Now If you ask me why I used keyword DEC instead of reserved word the answer is right in the begining of the page : http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html keyword DEC or reserved word DEC are the same !! No, not all keywords are reserved. The list at the bottom of http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html shows some examples. for instance : The keyword INT is a synonym for INTEGER, and the keyword DEC is a synonym for DECIMAL. bla bla bla ... Regards. == On Tue, 30 May 2006, Paul DuBois wrote: At 15:46 +0200 5/30/06, Gilles MISSONNIER wrote: Hello I could not find the answer through the online Search the MySQL manual. I run MySQL 4.1 In the 4.1 manual, the reserved words are listed here: http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html DEC is in the list. Identifier-quoting guidance is here: http://dev.mysql.com/doc/refman/4.1/en/legal-names.html In astronomy, RA and DEC are widely used coordinate names. Then I try to add a column named DEC : mysql alter table my_table add dec float; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec float' at line 1 UPPER case lead to the same error. It seems that the reason is that DEC is a keyword standing for decimal. I do not understand why this cannot be allowed for a column name. Is there a turn around ? This is annoying ; I add to name the column as DECL which is much less meaning full in the astronomy community. thanks, =_==_==_==_==_==_= =¯==¯==¯==¯==¯==¯= Gilles Missonnier IAP - [EMAIL PROTECTED] -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com =_==_==_==_==_==_= =¯==¯==¯==¯==¯==¯= Gilles Missonnier IAP - [EMAIL PROTECTED] 01 44 32 81 36 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: question+comment : Re: set DEC as a column name : forbidden
Hello again Paul, 1-Why the error code (1064) can't lead explicitly to the syntax problem ? I'm sorry, I don't understand the question. The mysql command returned the error code [ ERROR 1064 (42000) ] I search in the manual with ERROR 1064, and then get the page : http://dev.mysql.com/doc/refman/4.1/en/error-messages-server.html Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR) Message: %s near '%s' at line %d I cannot figure out what is wrong from this info, whereas error code 1063 or 1065 are far more explicit. Why the error code (1064) is not telling : wrong usage of reserved word or something like this ? that could be linked to a page showing some exemple of what to do ? === 2-Could you tell me how I could go directly to the relevant page ? [ Hard for you to feel like a lambda user in MySQL ] It sounds like you mean, When I have a problem, how can I instantly find the solution? I don't think I can answer that. I'm not so childish : just like to have more pieces, but smaller pieces, ORTHOGONAL, so that each could be adressed with appropriate search : you give me a perfect opportunity to explain my point : the following page DO exist : http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html but http://dev.mysql.com/doc/refman/4.1/en/keyword.html http://dev.mysql.com/doc/refman/4.1/en/keywords.html http://dev.mysql.com/doc/refman/4.1/en/keyword-words.html http://dev.mysql.com/doc/refman/4.1/en/keywords-words.html do not exist. also, why is there a keyword list in the reserved-words.html page ? this is not orthogonal. In what keyword and reserved-words differ ? also, the relevant point for me was : The identifier quote character is the backtick (`): And it is found on the same page telling about - maximum length, - Unicode, - ANSI_QUOTES SQL mode, - default character set - recommendation on naming == Hope not being asking too much. regards. -Gilles Missonnier - -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: question+comment : Re: set DEC as a column name : forbidden
Hi Gilles, I search in the manual with ERROR 1064, and then get the page : http://dev.mysql.com/doc/refman/4.1/en/error-messages-server.html Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR) Message: %s near '%s' at line %d I cannot figure out what is wrong from this info, whereas error code 1063 or 1065 are far more explicit. Why the error code (1064) is not telling : wrong usage of reserved word or something like this ? that could be linked to a page showing some exemple of what to do ? If MySQL's parser could easily tell that you had used a reserved word in a place where it can't be used as such, they wouldn't need to be reserved words, would they? :) Regards, Jeremy -- Jeremy Cole MySQL Geek, Yahoo! Inc. Desk: 408 349 5104 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]