Execute Query At Cursor not working correctly

47 views
Skip to first unread message

Diddy

unread,
Aug 28, 2014, 1:35:11 PM8/28/14
to execut...@googlegroups.com
Hi,

It seems like 'Execute Query at cursor' executes every query in the current editor tab. 

If I have this in my editor tab:

SELECT 1;
SELECT 2;

And the cursor is within the second statement and I click the 'Execute query at cursor' button, I get results for both queries.
Can you please double check this and fix it if is really a bug.

Thanks,
Diddy

Takis Diakoumis

unread,
Aug 28, 2014, 5:14:11 PM8/28/14
to execut...@googlegroups.com
hi

execute at cursor requires a line break between statements - it does not look for any other delimeter type other than a new line.

let me know how you go.

thanks
Takis



--
You received this message because you are subscribed to the Google Groups "Execute Query" group.
To unsubscribe from this group and stop receiving emails from it, send an email to executequery...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
http://executequery.org

Diddy

unread,
Aug 29, 2014, 3:00:17 AM8/29/14
to execut...@googlegroups.com
Thanks for your reply. I think this is a bit dangerous. From my experience with other query clients the standard behaviour is to run one statement only, where each statement is ended with a ;
You could make this configurable, but I would definitely recommend to set the default to ;
Can you please implement this for the next release?

Takis Diakoumis

unread,
Aug 29, 2014, 3:11:40 AM8/29/14
to execut...@googlegroups.com
hello

if you want to execute each statement in the editor in sequence while respecting the statement delimiter, use the main execution method from the editor toolbar - the first toolbar button with the big green arrow/pointer or F5 as the shortcut. this will take all the editor contents and determine where each statement starts and ends and execute them in turn.

i don't think its a huge stretch to have line delimiters between queries if executing at the cursor position and i don't want to enforce using query delimiters ( ; ) for this feature. as it stands you don't need to and the line break is taken as the point of differentiation with other statements. i and others often use this feature as a quick way of having access to a number of different queries within  the editor and selectively executing depending on what you're doing. 

again, the main execute method (F5 for short) might be what you're looking for - alternatively you may highlight any number of statements and execute them and the query delimiters are respected - you could also try that (short cut after selecting your queries is CTRL-SHIFT-ENTER).

thanks again :)
Takis


Diddy

unread,
Aug 29, 2014, 4:03:47 AM8/29/14
to execut...@googlegroups.com
Hi Takis,

I only want to execute the statement where the cursor is in and the ; should be respected in this case. As I am a lazy person, I also do not want to highlight the whole query just to execute it. I think you should give the user the option to have this behaviour ... it's a quite common implementation in a lot of query browsers. Your implementation is however specific - so new users will not quite expect this behaviour (I found another recent forum post here from another user who had exactly the same problem).

I usually save my scripts. I have several statements within my files. I might just want to go to one of these statements, place my cursor in it and execute it - this particular one, not the whole file, without highlighting the whole statement and expecting that the ; will be respected.

Best regards,
Diddy
Reply all
Reply to author
Forward
0 new messages