Home » Forums » Suggestions and New Features
 
Query Editor (1293 previews)
Query Editor Posted in 27th, 07/2005 05:20 by bart.degryse
If I have multiple statements in one query editor Execute always runs them all. However for ease of management I often group related statements (eg a create table statement together with some add constraint statements, some create rule statements, some create trigger statements, some grants and a comment statement for that table) in a single query editor. In such case it would by handy if could execute only one of those statements (eg the one where the cursor is in).
For Oracle management I use Toad. The toad shortcut for Execute is Ctrl+Enter. This executes only the statement the cursor is in. If you want to execute all statements you can do so through a special tool bar icon or context menu item. This works very intuitively and is also very flexible.
Bart Degryse / Indicator NV
Re: Query Editor Posted in 27th, 07/2005 10:12 by support
Hi,

I think that can be very easily simulated. DBManager Query Editor allows to execute only the selected text in the editor's buffer. That way you may have multiple statements in one long query. Selecting one statement and pressing F5 or clicking on the execute button will run only the selected statement producing only one result.
On the other hand I liked the idea of having a special shortcut to execute the query under the cursor. But this would require a lot of extra work as all queries can be multiple lines and owuld also require a good parser in order to see where the statement starts and ends. This should be very difficult to implement as DBManager supports multiple database engines and each one of them supporting different SQL syntax.

Best Regards,

Support / DBTools Software
Re: Query Editor Posted in 27th, 07/2005 11:31 by bart.degryse
I don't this it would require that much parsing. Toad requires each statement to be ending in ";" As far as I know this is for all database servers an acceptable statement ending. Also it can easily be used by the parser as splitting token between each statement.
Bart Degryse / Indicator NV
Re: Query Editor Posted in 27th, 07/2005 01:14 by support
Hi,

Although it is correct to say that the character ";" is the statement terminator this would be not true for statements that create functions, stored procedures and triggers. These statements allow to have this terminator for a single line of command, which would produce incorrect behaviours.
On the other hand the new DBManager 3.1.0 has a builtin statement terminator "GO" which is also the default for MSSQL Enterprise Manager. This can be turned ON in Preferences.
If the use of this terminator is set it would be able to use a special key to run a command between statement terminators whcih would easier to parse in this case.
We will implement something like this, any comments or suggestions on this would be really appreciated.

Best Regards,

Support / DBTools Software
Re: Query Editor Posted in 28th, 07/2005 03:18 by bart.degryse
You're right of course about the ; terminator. I had indeed not thought about function ao. Though I must say that Toad uses a different editor for functions. This procedure editor (as they call it) doesn't allow multiple statements. Only the SQL editor. I'll send some screenshots from Toad to suporte@dbtools.com.br Maybe you can get some ideas from them.
Bart Degryse / Indicator NV
Query Editor (1293 previews)
Legends

Topic has Replies
Topic With no Replies
 
Home » Forums » Suggestions and New Features