SqlDbx
You are not logged in.
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.
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
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.
OK.. Maybe this is intentional, but it owuld be great if empty blocks, or rows with just spaces, logically worked the same way.
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
Tested the change and I really like it! Thanks!
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
Selection and execution are two different actions.
It does not seem to be a good idea to combine them into one action.
Offline
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
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
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
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
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