SqlDbx Forum

SqlDbx

You are not logged in.

#1 2009-05-01 09:18:54

Jason Lipman
Guest

Shortcut To Run Block WHere Cursor Is

I would like to have the feature where you can run the sql block that the cursor is in without having to highlight the whole block of code.

#2 2009-05-01 12:51:35

sqldbxhelp
Administrator

Re: Shortcut To Run Block WHere Cursor Is

Two things you can do

1. Put cursor before the block you want to run and press Ctrl+B
This will select next block to run

2. Put empty line before and after the block you want to run.
Put cursor anywhere between and press Ctrl+Shift+B.
This will select everything between empty lines

If you want to execute statement on a single line press Ctrl+Enter

Offline

#3 2009-06-05 14:36:26

Jason Lipman
Guest

Re: Shortcut To Run Block WHere Cursor Is

Option #2 is great, but I notice a small bug in Ctrl-Shift-B.... The block currently needs to have a carriage return on both sides of the block, but if there is a space, or multiple rows with spaces, the command will select more .. going up or down to the next block of SQL.

#4 2009-06-05 14:37:22

Jason Lipman
Guest

Re: Shortcut To Run Block WHere Cursor Is

OK.. Maybe this is intentional, but it owuld be great if empty blocks, or rows with just spaces, logically worked the same way. smile

#5 2009-06-05 16:38:11

sqldbxhelp
Administrator

Re: Shortcut To Run Block WHere Cursor Is

No it's not intentional and I agree that line with spaces or tabs only should behave as separator.
This will be addressed in a next release.

Offline

#6 2009-10-15 09:49:08

Jason Lipman
Guest

Re: Shortcut To Run Block WHere Cursor Is

Tested the change and I really like it! Thanks!

#7 2011-05-20 15:13:02

Akorde
Member

Re: Shortcut To Run Block WHere Cursor Is

Now that you have the Cntrl+Shift+B, would it be possible to give another key which selects the current block and also execute it.
Of course, even better would be user defined keys !

Offline

#8 2011-05-23 09:53:04

sqldbxhelp
Administrator

Re: Shortcut To Run Block WHere Cursor Is

Selection and execution are two different actions.
It does not seem to be a good idea to combine them into one action.

Offline

#9 2011-06-27 16:13:41

Allen
Member

Re: Shortcut To Run Block WHere Cursor Is

Generally I add blank rows to SQL statements for readability.  Ctrl-Sh-B USED to work with these if I added a single space on the blank line... this is no longer the case.  Therefore, I can no longer select my BLOCKS of SQL statements easily.

Offline

#10 2011-06-27 17:58:22

sqldbxhelp
Administrator

Re: Shortcut To Run Block WHere Cursor Is

I am not sure why you need to add single blank.
Ctrl+Shif+B works for empty lines or lines with spaces/tabs only.

Offline

#11 2011-10-18 09:08:41

garbuya
Member

Re: Shortcut To Run Block WHere Cursor Is

In many database tools (for example, TOAD, SqlDeveloper, SQLTools++, etc.) there are two buttons - one to run a single block, delimited by blank lines OR SEMICOLONS(;) and another one to run a whole script.
Is it possible to have such nice feature in SQLDbx?
Or, at least, have a block delimited not only by blank lines, but also by semicolons?
For example

select *
from t1
;
select * from t2;
select *
from t3;

Why it should be a blank line in between these queries??? Other tools do not require it! The ";" is the commonly used block delimiter in almost every database, so why not to use it here?

But in general,  having two buttons is the only proper solution. Why use 2 hands to click  Ctrl-Shift-B (not the best combination, by the way! You cannot rich to all 3 buttons with one hand) if block can be executed in one single mouse click??????

Last edited by garbuya (2011-10-18 09:17:57)

Offline

#12 2011-10-18 10:06:22

sqldbxhelp
Administrator

Re: Shortcut To Run Block WHere Cursor Is

You have a valid point here. Will need to check on this.
By the way you can use Ctrl+B to select next SQL batch to run

Offline

#13 2011-10-18 14:25:05

garbuya
Member

Re: Shortcut To Run Block WHere Cursor Is

Ctrl+B highlights only down from the current line. So if I am making changes in the middle of a big sql which is several pages long I still have to scroll up to the first line.
In addition Ctrl+B ignores blank lines and highlights everything till ";", so it can grab more then one block at the time.
Personally I don't see much usage for this shortcut at all. It is almost useless.
Maybe it make sence to switch meaning of  Ctrl+B and Ctrl-Shift-B ? At least you will be able to quickly highlight a block with one hand no matter where your cursor is, without scrolling to the first line.

Offline

Board footer

Powered by FluxBB