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.

Bug 69311 - [50cat] SQL Editor should provide a way to execute selected statement
Summary: [50cat] SQL Editor should provide a way to execute selected statement
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 5.x
Hardware: PC Solaris
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
: 69319 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-25 09:27 UTC by vanob
Modified: 2006-08-28 13:41 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vanob 2005-11-25 09:27:09 UTC
[ 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.
Comment 1 Andrei Badea 2005-11-25 14:57:44 UTC
*** Issue 69319 has been marked as a duplicate of this issue. ***
Comment 2 cezariusz 2005-12-19 15:24:38 UTC
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.
Comment 3 Andrei Badea 2005-12-20 10:15:12 UTC
To cezariusz: yeah, that could be a good idea, but I'd use ';' as the statement
separator instead of the empty line.
Comment 4 Andrei Badea 2006-04-18 16:12:37 UTC
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.
Comment 5 Lukasz Grela 2006-04-19 09:14:30 UTC
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.
Comment 6 Andrei Badea 2006-04-20 18:45:36 UTC
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?
Comment 7 Lukasz Grela 2006-08-28 13:41:14 UTC
v.