# TDA 2.7 Set Variable Question

**URL:** <https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [February 21, 2012, 4:01pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116 "2012-02-21T16:01:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 21, 2012, 4:01pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/1 "2012-02-21T16:01:44Z")

</div>

I am trying to build an automation process where my report will get updated based on a variable.

I am setting the variable using a sql script:

Select  
Case When DD.(MSP\_DT) = TRUNC(SYSDATE-1) THEN 1  
ELSE 0  
END AS DateCheck  
From Schema.Table DD

I am having an issue where it is saying no connection…and I am connected to the database… Any help?

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 21, 2012, 4:37pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/2 "2012-02-21T16:37:32Z")

</div>

Can you post a sample script where you are having this issue? There is connection info in the variable activity. There must be some issue there.

Debbie

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 21, 2012, 6:02pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/3 "2012-02-21T18:02:47Z")

</div>

Timestamp Message  
2/21/2012 3:45:02 PM Activity ‘Set\_Variable\_1’ validation failed: Connection for SQL is not set.

I dont see the connection for the set variable…could you possibly point me in the right direction.

Thanks Debby, Appreciate the quick repsonse.

I would provide a full script but I had a computer issue.

When I go into the Variables section It offers me the option to set the variable or SQL. I enter the SQL but cannot seem to get rid of the exclamation mark. I have even tried to put the connection before the set variable but it will not allow me to drag the set variable into the connections activity.  
 ![TOAD.jpeg](https://global.discourse-cdn.com/quest/original/2X/0/04a7982da06660380e1a0c2a9625112b2bbc73a4.jpeg)

---

<div class="post-metadata">

**Author:** ![IgorM](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/igorm/32/116_2.png) [@IgorM](https://forums.toadworld.com/u/IgorM)\
**Post date:** [February 21, 2012, 7:20pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/4 "2012-02-21T19:20:35Z")

</div>

Please see attached picture.

Igor.

 ![SetVariable.jpeg](https://global.discourse-cdn.com/quest/original/2X/a/aed394beab038af3d02806c06e84291211bb1230.jpeg)

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 21, 2012, 7:40pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/5 "2012-02-21T19:40:06Z")

</div>

Double click on activity to activity editor. Then press drop down to get variable collections. In this editor select the SQL drop down. This will display a small editor where you can select your connection, enter SQL and test.

Debbie

 ![AutoVar.png](https://global.discourse-cdn.com/quest/original/2X/d/d96c57ceaaa9545a06d4fb604696fdac48d18237.png)

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 22, 2012, 9:50am UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/6 "2012-02-22T09:50:34Z")

</div>

Thanks you guys…really appreicate it

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 22, 2012, 10:26am UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/7 "2012-02-22T10:26:12Z")

</div>

Ok have another issue. I am getting an error everytime I run something. Could be a system issue but not sure.

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 22, 2012, 10:27am UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/8 "2012-02-22T10:27:33Z")

</div>

I am getting this error. I have both 3.0 and 2.7 installed on the system and 3.0 runs fine but 2.7 gets this error everytime.

 ![TOAD 2.jpeg](https://global.discourse-cdn.com/quest/original/2X/b/b5f0c6bd1f6ca99f7e47494d7d1df9e8f1ab44ea.jpeg)

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 22, 2012, 2:09pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/9 "2012-02-22T14:09:41Z")

</div>

Are you using a Run Activity when you get this error? Or does the script ever get running?  
Can you send me your automation script and a log file for it to my email? I will take a look and see if I can suggest something.

[dpeabody@quest.com](mailto:dpeabody@quest.com)

Debbie

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 22, 2012, 3:10pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/10 "2012-02-22T15:10:35Z")

</div>

The script will run but this happens everytime I try to run a script. Automation and just a regular SQL statement outside of automation I still get this.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 22, 2012, 3:26pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/11 "2012-02-22T15:26:24Z")

</div>

Are any other copies of Toad running at the time of the error? Also, go to Toad | Options. What is your “Allow multiple copies of Toad to run” option? Try changing it.

Debbie

---

<div class="post-metadata">

**Author:** ![daniel.albrecht\_046](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@daniel.albrecht\_046](https://forums.toadworld.com/u/daniel.albrecht_046)\
**Post date:** [February 22, 2012, 3:54pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/12 "2012-02-22T15:54:10Z")

</div>

Yes I usually have some automations running in 3.0 and or TOAD for Oracle 11. Checked the multiple copies of toad to allow that but still got the same error.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 22, 2012, 4:28pm UTC](https://forums.toadworld.com/t/tda-2-7-set-variable-question/7116/13 "2012-02-22T16:28:37Z")

</div>

That error stack is very unusual. Can you check your logging type. Is it set to “event”. If so please change to “File”.

Debbie  
 ![Logging.png](https://global.discourse-cdn.com/quest/original/2X/2/2c4e09705cf7ec85ea087daf14fcd8eac963b925.png)
