Enhancement Request
tdewitt
Posts: 7
When entering comments, Sql Prompt will automatically capitalize SQL Keywords that are typed into the comment. Such as this phrase: "date from product order" becomes "date FROM product ORDER". It would be nice if SQl Prompt recognized that you were entering text in a comment line/block and not perform the capitalization.
Comments
Would you be able to show me some example syntax that recreates this problem. I don't experience the same symptoms when I tested it here, so there must be something else confusing the parser.
Also, could you let me know which version of SQL Prompt you are using. I tested this in SQL Prompt 3.6.
not a comment but text between '' should not be messed with.
Is it possible that there is some invalid SQL above the string that is confusing the parser? Simply having the string as the query is invalid SQL and would stop the parser functioning correctly, but you may be experiencing the same symptoms in real world examples.
For example, an unclosed comment block could cause this, or something like an un-commented-out <more code here> reminder in the script could break the parser.
If you have experienced this issue with a valid script, then could you please send me an example (here or by pm) and I will continue to investigate.
Thanks,
I am running V 3.6 and I can't get it fail , in either /* */ or -- comments
Cheers
Mike
paste in the following:
Start typing into the string part of the error. For example, try to make it 'A timeout has occured!'. Timeout is a keyword and will get capitalized.
If you either add 'END' after the Raiseerror or comment out the RETURN statement it will let you type freely.
I have a snippet set up that always adds my end when I add begin
I use be to add a BEGIN - newline- END pair
So I wouldn't see a problem like this
Mike
This is just one way to reproduce the problem. Not having a RETURN in a proc can sometimes cause it. It should never auto-complete text inside a comment.
The only answer to this set of issues is that with the current release of SQL Prompt, any invalid or illegal SQL will break the parser. This will have undesired effects when writing comments, strings etc.
This was originally thought of as something that was not going to fixed as it was viewed that not much can be done about parsing invalid SQL.
However, this seems to be quite an issue for quite a lot of users so the development team are going to take steps to address this issue in a future version. It is curently under review, and for your reference the bug tracking number is SP-793.
If you would like to run through your script to see the code that SQL Prompt has a problem with, SQL Refactor should be able to help.