As has been discussed at least a few times, simple syntax errors are generally closed as Too Localized. The community's common practice seems to have coalesced around this more and more in the past 6 months, which is excellent.
- Should syntax error questions be closed as too localized after being answered?
- Are questions solved by fixing a typo or basic syntax error "too localized"?
Dealing with a specific class of these has left me with doubts, however. In mysql, we see quite a few questions related to the use of unquoted MySQL reserved keywords as identifiers in queries. This results in error messages which always look exactly like:
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 'THE_RESERVED_KEYWORD
A few of these are common enough that it is a simple matter to search on the error message to locate an already existing duplicate to close against. The DESC
keyword, for example is really common. ORDER
is also common, anecdotally so are TO
, KEY
, INDEX
and others...
So when one of these is encountered, the mysql community can usually spot it immediately. My instinct is to search on the error message for a duplicate and closevote if I find one. If I don't find the duplicate I have taken a few different actions:
- Just answer it
- Answer it as community wiki and closevote as Too Localized since it's a syntax error
- Leave a comment pointing to the MySQL docs and closevote as Too Localized (typically I do this now...)
The more I think about it though, closing these as Too Localized seems like the wrong approach. While it is entirely possible that the OP might have a syntax error in a CREATE PROCEDURE
statement, experience tells me that a message like "the right syntax to use near 'procedure" is indicative of an inappropriate use of a keyword.
The error message itself then becomes a really valuable clue to finding the exact cause of and solution to the problem, unlike variable typos, missed semicolons, or unclosed braces.
Speaking only of the MySQL keywords, there are so many possibilities that it seems unwieldy to create a reference question like the PHP community has done with the error message reference, when the solution to the whole class of errors is the same in every case.
So...
What does the community think is best? If the error message is specific and exact should we:
- Close as Too Localized (potentially inviting repeats of the same question later on (which may also get closed))
- Answer and build the search reference for future askers (potentially inviting duplication)
- Something else?