This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 200511241900 ] [ JDK VERSION : 1.5.0_05 ] This feature is so basic it should be implemented to mark the sql editor usable. It's difficult to work with sql editor without that feature. There are two workarounds. Comment out the statement(s) you do not want to run or open one connection per statement. It would be good to have the possibility to select some statement and execute it.
*** Issue 69319 has been marked as a duplicate of this issue. ***
Or even better: treat empty line as a statement separator, so I could have many statements in one sql editor and execute only the currect one (that is where the cursor is located), like in TOAD.
To cezariusz: yeah, that could be a good idea, but I'd use ';' as the statement separator instead of the empty line.
This has been implemented in the daily build from Apr 18. It is possible to either select some text and choose Run Selection from the editor' popup menu, or just click in the middle of a statement and choose Run Statement.
at present if sql statements are not separated by semicolons there is no possibility to run one statements by selecting it, so maybe the better approach would be if statement is selected should be just parsed and executed, in case that selected statement is in valid because it contain some part of another statement as well database throws error,I think that there is no need to utilize feature which recognize only full statement (beetwen semicolons) and don't take into consideration partialy selected statement - user is aware what is selected.
To be more concrete, the editor now executes the selection by parsing the *whole* SQL script into statements using semicolons as delimiters. It then only executes the statements wholly contained in the selection. As Lukas pointed out, this does not work for scripts not using semicolons as delimiters (e.g., scripts for MS SQL Server). If I understand correctly, his suggestion is to parse just the selection (not the whole script). This would allow executing at least single statements in a script not using semicolons as delimiters. The disadvantage is that you have to select exactly what you want to execute (the old way allowed you to e.g. include the beginning/end of the statements before/after the selection and they would be ignored). But maybe that isn't really a problem. Overall it looks like a good idea to me. To reporter: any thoughts before I start implementing this?
v.