# Execute query with Ctrl+Enter: Variable names

**URL:** <https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263>\
**Category:** Toad for Oracle - Beta\
**Created:** [May 6, 2022, 8:59am UTC](https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263 "2022-05-06T08:59:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterLang](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@PeterLang](https://forums.toadworld.com/u/PeterLang)\
**Post date:** [May 6, 2022, 8:59am UTC](https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263/1 "2022-05-06T08:59:48Z")

</div>

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

```auto
BEGIN
  SELECT 1 FROM dual WHERE dummy = in_some_parameter;
  SELECT 1 FROM dual WHERE dummy = in_another_parameter;
END;

```

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

![image](https://global.discourse-cdn.com/quest/original/2X/7/767021d4608bc32a30b19184f4d2bf8c95263b5c.png)

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:

```auto
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?

Thanks!

---

<div class="post-metadata">

**Author:** ![PeterLang](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@PeterLang](https://forums.toadworld.com/u/PeterLang)\
**Post date:** [July 27, 2022, 11:56am UTC](https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263/2 "2022-07-27T11:56:32Z")

</div>

Did you see this one?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [July 27, 2022, 12:39pm UTC](https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263/3 "2022-07-27T12:39:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pavel](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@Pavel](https://forums.toadworld.com/u/Pavel)\
**Post date:** [July 29, 2022, 3:41pm UTC](https://forums.toadworld.com/t/execute-query-with-ctrl-enter-variable-names/55263/4 "2022-07-29T15:41:40Z")

</div>

Will be included with next Beta version.
