MySQL not liking certain "alias_name"
-
Yesterday I was in MySQL Query Browser building a SELECT statement. When I used the alias of "LayoutFile" in my SELECT statement, MySQL returns no resultset. Try it yourself. "SELECT (column) AS LayoutFile FROM (table)" - Replace (column) with of course, the column name, and (table) with, the table name. Now, change "LayoutFile" to whatever else you want (Ex. "LayoutFil", etc.) and it'll return the expected resultset. Ok, just did some testing and "LaoutFile" doesn't work either, strange stuff indeed. I haven't submitted this "Bug" to MySQL as of yet, I'm not sure how serious it is. I figure "LayoutFile" is a reserved word or variable inside MySQL? Anyone else think of something? :-D
-
Yesterday I was in MySQL Query Browser building a SELECT statement. When I used the alias of "LayoutFile" in my SELECT statement, MySQL returns no resultset. Try it yourself. "SELECT (column) AS LayoutFile FROM (table)" - Replace (column) with of course, the column name, and (table) with, the table name. Now, change "LayoutFile" to whatever else you want (Ex. "LayoutFil", etc.) and it'll return the expected resultset. Ok, just did some testing and "LaoutFile" doesn't work either, strange stuff indeed. I haven't submitted this "Bug" to MySQL as of yet, I'm not sure how serious it is. I figure "LayoutFile" is a reserved word or variable inside MySQL? Anyone else think of something? :-D
OUTFILE is a keyword in MySQL syntax, so it looks like a parsing bug.
-
OUTFILE is a keyword in MySQL syntax, so it looks like a parsing bug.
Ah, that makes sense, thanks for clarifying.
-
Yesterday I was in MySQL Query Browser building a SELECT statement. When I used the alias of "LayoutFile" in my SELECT statement, MySQL returns no resultset. Try it yourself. "SELECT (column) AS LayoutFile FROM (table)" - Replace (column) with of course, the column name, and (table) with, the table name. Now, change "LayoutFile" to whatever else you want (Ex. "LayoutFil", etc.) and it'll return the expected resultset. Ok, just did some testing and "LaoutFile" doesn't work either, strange stuff indeed. I haven't submitted this "Bug" to MySQL as of yet, I'm not sure how serious it is. I figure "LayoutFile" is a reserved word or variable inside MySQL? Anyone else think of something? :-D
You might try AS `LayoutFile`
Humble Programmer
-
You might try AS `LayoutFile`
Humble Programmer
Surrounding the alias_name with the apostrophe worked dandy, thanks a lot for the tip, I've been thinking of how to use a different name, but "LayoutFile" is the best and I couldn't use it until you posted. Cheers! :-D
-
Surrounding the alias_name with the apostrophe worked dandy, thanks a lot for the tip, I've been thinking of how to use a different name, but "LayoutFile" is the best and I couldn't use it until you posted. Cheers! :-D
Please make sure that you are using the key above the tab key.... ` not ' I think that if you use ' the key next to the enter key it will make it think that it is a string.
Humble Programmer
-
Please make sure that you are using the key above the tab key.... ` not ' I think that if you use ' the key next to the enter key it will make it think that it is a string.
Humble Programmer
BTW I believe if for any reason you ever start running these queries against a linux server if you do not have the `` marks it will give an error, also on linux servers casing matters.
Humble Programmer
-
Please make sure that you are using the key above the tab key.... ` not ' I think that if you use ' the key next to the enter key it will make it think that it is a string.
Humble Programmer
Will do, but using the apostrophe near the enter key worked fine.. not sure if it'll raise problems down the road? I can use the other instead I guess.