'S' in 'SELECT' not included in SQL

SunDog

Member²
In a SQL window, it happens every once in a while that the 'S' in 'SELECT' is not highlighted and attempts to execute the statement result in ORA-0900 - invalid SQL. The highlighted SQL starts at the 'E' in 'SELECT'.

I didn't do anything except type these two statements i.e. no didn't paste the SQL. If I copy the whole window and paste into another SQL window, it then works fine.

Is there something wrong with the auto-select?

2807
 
Does it matter where the cursor is when you execute the statement? (i.e: after the last semicolon, or before the "S", or...)

Does it matter how you execute the statement? Either via pressing F8 or clicking the toolbar button or choosing the menu option?
 
It's version 7.1.1.1339.

It doesn't appear to matter where the cursor is. I have to manually highlight the entire statement for it to execute. It also happens with other DML besides Selects.

I usually press F8 or the toolbar to execute and I believe it happens for both.
 
I have experienced the same problem. It seems to happen on the SQL window that I have set up to automatically launch with SELECT * FROM. If I click the beautify button the problem goes away. Also, the code completion does not work in this situation. Hope this helps.
 
Originally posted by Marco Kalter:
Can you send me an example file?
No, I can't! Saving the SQL Window as a file and reopening it makes it work fine.

I've had other cases where I get the same error with comments above. For example, something like the following (excluding the ====), also wouldn't work:

======================================
/* SOME COMMENTS
*/

SELECT column
FROM table;
======================================
Placing the cursor in the SELECT and executing gives the error, the "S" has a squiggly red underline, and the cursor is placed in the comment block.

So I can't supply a reproducable test case for you. But if David K gets the same behaviour, there must be something not right.

Thanks
 
I get the same problem. It seems to be when I have lines commented out in that PL/SQL Developer can't tell where one SQL statement starts and the next one begins. The Beautifier also can't handle the statement properly till I've removed all of the comments. This seems to clear the problem with the auto-select functionality also.

Sometimes it was highlighting not from the "e" of select, but from several characters further along the first line.

Can this be fixed - it's a very annoying bug in an otherwise excellent product, and never used to happen in v6.

I'll email my "before" file with the comments, and my cleaned-up "after" file to Marco.
 
Thanks. I received your file, and there does indeed seem to be some problems. We'll fix it, and I will post a patch here when it is available.
 
When I use in context menue "Refactoring >> Rename item..." the first letter of variables to rename in code is ignored for renaming. The first character after variablenames in code is deleted after renaming. In my case I couldn't recompile my package, because all commas are gone.

F.e. ln_root_id >> ln_rootx_id:
Before renaming: ln_root_id,
After renaming: lln_rootx_id

Maybe it's the same cause as above...
 
Back
Top