Execute query with Ctrl+Enter: Variable names

TOAD has a great feature where using Ctrl+Enter to execute a query contained in code suggests bind variables.

  SELECT 1 FROM dual WHERE dummy = in_some_parameter;
  SELECT 1 FROM dual WHERE dummy = in_another_parameter;

Selecting only the first query in the (incomplete) code above and executing with Ctrl+Enter shows this dialog:


Since numbers are used for bind variable names, testing the second query afterwards re-uses :0 so the values need to be changed with every new query. It also cannot be reused when the order of bind variables changes for some reason.

Would it be an option to use the actual name instead of putting it in the comment?

SELECT 1 FROM dual WHERE dummy = :in_some_parameter;

With a member of a type, only using the member name or replacing "." by "_" might be good options:

SELECT 1 FROM dual WHERE dummy = in_some_object.sub_object.some_member;
-> :some_member
-> :in_some_object_sub_object_some_member

Bonus: The "Edit SQL" dialog can be confirmed with Alt+O, the "Variables" dialog with Enter, but only when not in the text field.
Would it be possible to (also) allow Ctrl+Enter for both of them?


Did you see this one?

Thanks for the reminder. I'll log it so we don't forget. We'll get to it soon.

1 Like

Will be included with next Beta version.

1 Like