# Derive email destination from database query?

**URL:** <https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [September 5, 2009, 12:41pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027 "2009-09-05T12:41:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 5, 2009, 12:41pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/1 "2009-09-05T12:41:54Z")

</div>

Using TDA automation features, is it possible to distribute reports via email based on values found in database tables?

---

<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:** [September 9, 2009, 8:40pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/2 "2009-09-09T20:40:49Z")

</div>

Yes. You can do this with version 2.5 that is now available. Automation can use variables in this release and can set these variables from the values in a table. Let me know when you have this installed and I can build you an example automation script that does this.

Debbie

---

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 10, 2009, 10:16am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/3 "2009-09-10T10:16:04Z")

</div>

Debbie, I have just upgraded from 2.1, so I would appreciate your guidance on this.  
Thanks,  
Julian

---

<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:** [September 10, 2009, 3:03pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/4 "2009-09-10T15:03:15Z")

</div>

I have attached some sample files on how use email addresses from a table. Here are the steps:

1. I have included two sql files. One creates a table (EMAIL\_ADDRESSES) and inserts values for two email addresses. The second file does a select from this table.

2. For the rest of these steps please open up and refer to the Automation script called ‘Script\_Email\_Test.tas’.

3. First add a ‘Set Variable’ activity to hold a single email address. Give it a name, I used EMAIL\_ADDRESS. Initialize it to a string such as ‘EMPTY’. (See the Set\_Variable\_1 activity in script)

4. Add a Execute Script activity. This activity will execute a SQL statement and keep the results in a variable that can be used in the rest of the script. I set this activity to the EMAIL\_QUERY.sql in the attachement. I called the result variable EMAIL\_TABLE. See Execute\_1 activity.

5. Add a ‘Loop Dataset’ activity and set it to the result set you named in step 4. (EMAIL\_TABLE). This activity will execute your steps you add for every row of EMAIL\_TABLE.

6. You need to set your variable created in step 3 to the current row value. To do this, add a ‘Set Variable’ activity. Choose the name of your variable from the drop down(EMAIL\_ADDRESS). Use the ‘#’ symbol to de-reference the value of the column. So to set the value of this variable to the current content use ‘#EMAIL\_TABLE.EMAIL#’. See ‘Set\_Variable\_2’ in sample script.

7. Add whatever other activities you want to execute for every email address in your table.

8. Add your email acitivity. In the To; attribute de-reference your variable. IE: ‘#EMAIL\_ADDRESS#’. See ‘Email\_1’ activity in sample script.

Give this a try and if you have any issues please attach a screen shot and zip up all of your files for me to review. include the \*tas file and any error log.

Have fun!

Debbie  
[TDA\_AUTO\_EMAIL.zip](https://global.discourse-cdn.com/quest/original/2X/3/3a2faa7e2e3f38db36f48a5c98ed88e64a96e6ae.zip) (1.89 KB)

---

<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:** [September 10, 2009, 3:03pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/5 "2009-09-10T15:03:15Z")

</div>

I have attached some sample files on how use email addresses from a table. Here are the steps:

1. I have included two sql files. One creates a table (EMAIL\_ADDRESSES) and inserts values for two email addresses. The second file does a select from this table.

2. For the rest of these steps please open up and refer to the Automation script called 'Script\_Email\_Test.tas'.

3. First add a 'Set Variable' activity to hold a single email address. Give it a name, I used EMAIL\_ADDRESS. Initialize it to a string such as 'EMPTY'. (See the Set\_Variable\_1 activity in script)

4. Add a Execute Script activity. This activity will execute a SQL statement and keep the results in a variable that can be used in the rest of the script. I set this activity to the EMAIL\_QUERY.sql in the attachement. I called the result variable EMAIL\_TABLE. See Execute\_1 activity.

5. Add a 'Loop Dataset' activity and set it to the result set you named in step 4. (EMAIL\_TABLE). This activity will execute your steps you add for every row of EMAIL\_TABLE.

6. You need to set your variable created in step 3 to the current row value. To do this, add a 'Set Variable' activity. Choose the name of your variable from the drop down(EMAIL\_ADDRESS). Use the '#' symbol to de-reference the value of the column. So to set the value of this variable to the current content use '#EMAIL\_TABLE.EMAIL#'. See 'Set\_Variable\_2' in sample script.

7. Add whatever other activities you want to execute for every email address in your table.

8. Add your email acitivity. In the To; attribute de-reference your variable. IE: '#EMAIL\_ADDRESS#'. See 'Email\_1' activity in sample script.

Give this a try and if you have any issues please attach a screen shot and zip up all of your files for me to review. include the \*tas file and any error log.

Have fun!

Debbie

 ![EmailExample.png](https://global.discourse-cdn.com/quest/original/2X/4/4f74fe56c75d07605352d0824efa9028d5edbcd9.png)

---

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 14, 2009, 4:34pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/6 "2009-09-14T16:34:31Z")

</div>

See attached; (original text lost in malfunctioning Quest browser)  
 ![TOAD_email_loop.jpeg](https://global.discourse-cdn.com/quest/original/2X/b/bd6590215957df1ee126dd5793c0204651c0457d.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:** [September 14, 2009, 6:49pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/7 "2009-09-14T18:49:23Z")

</div>

Yes. You can do this.  
First make a text file to be used as a email template. In the body put some symbol or text you can recognize to do a find/replace. You will need to keep your values in separate variables. Once you have this, use the find/replace activity to find and replace the tokens with the variables values and copy to a unique file name. Then in the Email activity use the last attibute which is ‘Use file for body’. This will use your edited template for the body of the email.

This can be used in the Loop data activity as discussed earlier.

Have fun

Debbie

p.s. I attached some sample files of this.  
[EmailTemplate.zip](https://global.discourse-cdn.com/quest/original/2X/5/56bb868d15892ed0b013f2b3edd9851395fe2e62.zip) (1.64 KB)

---

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 22, 2009, 2:16pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/8 "2009-09-22T14:16:11Z")

</div>

See captured image above (within TDA the Forum doesn’t work properly)  
 ![TOAD_email_loop.jpeg](https://global.discourse-cdn.com/quest/original/2X/0/0427512f67596ca4bf8cd47bafdbe7981d6677d2.jpeg)

---

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 22, 2009, 2:16pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/9 "2009-09-22T14:16:11Z")

</div>

See captured image above (within TDA the Forum doesn’t work properly)  
[Derive\_email.ppt](https://global.discourse-cdn.com/quest/original/2X/b/b01e31d0ae1d8bb8d44b81d2a0b1694d10478633.ppt) (114 KB)

---

<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:** [September 22, 2009, 3:06pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/10 "2009-09-22T15:06:42Z")

</div>

Unfortunately, the Find/Replace activity only handles one find and replace at a time. You can still use the same output file name as long at the output file name is not the same as your origianl template.

I have added change request 67,150 to add this feature. I don’t think it will make our next minor release but will be in the next major.

Debbie

---

<div class="post-metadata">

**Author:** ![julian.chasin\_625](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@julian.chasin\_625](https://forums.toadworld.com/u/julian.chasin_625)\
**Post date:** [September 22, 2009, 3:24pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/11 "2009-09-22T15:24:28Z")

</div>

Thanks for the reply, and for suggesting the add’l feature.

However, I can’t see how to reuse the same output filename: the 2nd find/replace would use the original template file as input? Then each subsequent f/r would eliminate the prior one. It seems I have to chain the input/output files for as many f/r as I need to make.

---

<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:** [September 22, 2009, 4:19pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/12 "2009-09-22T16:19:49Z")

</div>

The first Find/Replace would use the template as input and output to output file name.  
The second and supsequent find/replaceswould use the output file as the input and output file. Make sure the overwrite attribute is set to Yes.

I did find a bug in this where you have to have the output file existing in order to choose it as an output file. That should not be that way, but is easy to work around.

I have attached a sample automation script that does this.  
[Script\_1.tas](https://global.discourse-cdn.com/quest/original/2X/6/69e55a282c8412ce85fd1566df5a39f0bd3378bf.tas) (6.37 KB)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/13 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[ESCLATION.txt](https://global.discourse-cdn.com/quest/original/2X/6/6da7a95706341dba1acf856cd0415c41a327fc80.txt) (21.7 KB)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/14 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[FTRESCALATIONOUTPUT.txt](https://global.discourse-cdn.com/quest/original/2X/9/90a68bb95d456389f023f1a79e73c35aa35e1b7e.txt) (704 Bytes)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/15 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[EMAIL\_QUERY.sql](https://global.discourse-cdn.com/quest/original/2X/4/40e355b8278c9ab70bd061dab44c9bb73972931d.sql) (36 Bytes)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/16 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[ESCALATION.TXT](https://global.discourse-cdn.com/quest/original/2X/6/6cdd1df72259bb621a1d875c44b8783555052574.TXT) (278 Bytes)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/17 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[EMAIL\_TABLE.sql](https://global.discourse-cdn.com/quest/original/2X/a/ab4ba6dd915871007a201a00881ca9417829c620.sql) (267 Bytes)

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 16, 2010, 5:22am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/18 "2010-11-16T05:22:27Z")

</div>

i have data in a table as mentioned below table name temp\_ftr\_escalation

FTR\_ID GROUP\_ID ACTION NOTES STATUS DUE\_DATE ESCALATION\_LEVEL ESCALATION\_DATE ESCALATE\_TO EMAIL\_ADDRESS FTR\_ACTION\_ID  
7119 12 Welcome Call OPEN 01/11/2010 11:12:02 3 03/11/2010 11:12:02 LISA.MOYSE lisa.moyse@airtel-vodafone.je 566  
7208 12 Welcome Call OPEN 01/11/2010 11:12:47 3 03/11/2010 11:12:47 LISA.MOYSE lisa.moyse@airtel-vodafone.je 572  
7199 12 Welcome Call OPEN 01/11/2010 11:13:19 3 03/11/2010 11:13:19 LISA.MOYSE lisa.moyse@airtel-vodafone.je 580  
7210 12 Welcome Call OPEN 01/11/2010 11:13:37 3 03/11/2010 11:13:37 LISA.MOYSE lisa.moyse@airtel-vodafone.je 585  
7333 12 Welcome Call OPEN 01/11/2010 09:08:41 3 03/11/2010 09:08:41 LISA.MOYSE lisa.moyse@airtel-vodafone.je 592  
7388 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 609  
7429 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 621  
7436 12 Welcome Call OPEN 01/11/2010 09:00:09 3 03/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 628  
7441 12 Welcome Call OPEN 01/11/2010 09:00:10 3 03/11/2010 09:00:10 LISA.MOYSE lisa.moyse@airtel-vodafone.je 633  
7554 12 Welcome Call OPEN 04/11/2010 09:00:09 3 08/11/2010 09:00:09 LISA.MOYSE lisa.moyse@airtel-vodafone.je 635  
6729 12 Welcome Call OPEN 28/10/2010 15:33:31 3 01/11/2010 15:33:31 LISA.MOYSE lisa.moyse@airtel-vodafone.je 408  
7258 12 Welcome Call OPEN 29/10/2010 09:00:15 3 01/11/2010 09:00:15 LISA.MOYSE lisa.moyse@airtel-vodafone.je 428  
7266 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 436  
7274 12 Welcome Call OPEN 29/10/2010 09:00:16 3 01/11/2010 09:00:16 LISA.MOYSE lisa.moyse@airtel-vodafone.je 444  
6951 12 Welcome Call OPEN 01/11/2010 11:09:13 3 03/11/2010 11:09:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 531  
6953 12 Welcome Call OPEN 01/11/2010 11:09:25 3 03/11/2010 11:09:25 LISA.MOYSE lisa.moyse@airtel-vodafone.je 534  
6949 12 Welcome Call OPEN 01/11/2010 11:09:29 3 03/11/2010 11:09:29 LISA.MOYSE lisa.moyse@airtel-vodafone.je 535  
6731 12 Welcome Call OPEN 01/11/2010 10:17:14 3 03/11/2010 10:17:14 LISA.MOYSE lisa.moyse@airtel-vodafone.je 446  
6734 12 Welcome Call OPEN 01/11/2010 10:17:34 3 03/11/2010 10:17:34 LISA.MOYSE lisa.moyse@airtel-vodafone.je 449  
6738 12 Welcome Call OPEN 01/11/2010 10:17:52 3 03/11/2010 10:17:52 LISA.MOYSE lisa.moyse@airtel-vodafone.je 453  
6739 12 Welcome Call OPEN 01/11/2010 10:17:57 3 03/11/2010 10:17:57 LISA.MOYSE lisa.moyse@airtel-vodafone.je 454  
6743 12 Welcome Call OPEN 01/11/2010 10:18:13 3 03/11/2010 10:18:13 LISA.MOYSE lisa.moyse@airtel-vodafone.je 458  
6792 12 Welcome Call OPEN 01/11/2010 10:19:49 3 03/11/2010 10:19:49 LISA.MOYSE lisa.moyse@airtel-vodafone.je 479  
6992 12 Welcome Call OPEN 01/11/2010 10:21:03 3 03/11/2010 10:21:03 LISA.MOYSE lisa.moyse@airtel-vodafone.je 497  
7015 12 Welcome Call OPEN 01/11/2010 11:07:45 3 03/11/2010 11:07:45 LISA.MOYSE lisa.moyse@airtel-vodafone.je 509  
7025 12 Welcome Call OPEN 01/11/2010 11:08:43 3 03/11/2010 11:08:43 LISA.MOYSE lisa.moyse@airtel-vodafone.je 524  
7142 6 Check on Progress OPEN 28/10/2010 13:37:53 3 01/11/2010 13:37:53 VINOD.SUD vinod.sud@airtel-vodafone.je

i want to pick email id and send rest of the columns in th email text.

Can you suggest how i can automate this on tda

i have tried my level best for the same i am ataching the same for you reference so that if you can tell me how i can get this run

I need get this done on priority today can you please please help me to run this successfully  
[SScript\_Email\_Test.tas](https://global.discourse-cdn.com/quest/original/2X/b/bad0955ac8a0fac4558f8773d4f692ef39ef163c.tas) (13.8 KB)

---

<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:** [November 16, 2010, 9:35pm UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/19 "2010-11-16T21:35:34Z")

</div>

Hello,

Do I understand correctly that you actually want to send information from all columns of temp\_ftr\_escalation table to an address from ESCALATE\_TO column (one email per every row)? Also, do I understand correctly that you want to use ESCALATION.TXT as a template for those emails and FindReplace activity should be used for substituting fields in the template with real values from the table row? If this is the case, why not put content of the template into email body directly using variables?

What I would do:

- Remove Set\_Variable\_1 activity
- Remove Find\_replace\_1 activity
- Change Set\_Variable\_2 activity to return EMAIL (Name: EMAIL\_ADDRESS; Value: EMAIL\_TABLE.EMAIL)
- Change Set\_Variable\_3 activity to return FTR\_ID (Name: FTR\_ID; Value: EMAIL\_TABLE.FTR\_ID)
- Change Set\_Variable\_4 activity to return GROUP\_ID (Name: GROUP\_ID; Value: EMAIL\_TABLE.GROUP\_ID)
- Add more Set\_Variables activities to return all other values from the template (ACTION, STATUS, DUE\_DATE, ESCALATION\_LEVEL, ESCALATE\_TO, ESCALATION\_DATE)
- For the Email\_1 activity set property “To” to #EMAIL\_ADDRESS# and property “Body” to:

Good Morning

The below SR is going to escalate…

EMAIL: #EMAIL\_ADDRESS#  
FTR\_ID : #FTR\_ID#  
GROUP\_ID: #GROUP\_ID#  
ACTION: #ACTION#  
STATUS: #STATUS#  
DUE\_DATE: #DUE\_DATE#  
ESCALATION\_LEVEL: #ESCALATION\_LEVEL#  
ESCALATE\_TO : #ESCALATE\_TO#  
ESCALATION\_DATE: #ESCALATION\_DATE#

I tried this approach and it worked in my case.

Hope this helps,

Igor.

---

<div class="post-metadata">

**Author:** ![suryaprakash.j\_593](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@suryaprakash.j\_593](https://forums.toadworld.com/u/suryaprakash.j_593)\
**Post date:** [November 17, 2010, 4:00am UTC](https://forums.toadworld.com/t/derive-email-destination-from-database-query/6027/20 "2010-11-17T04:00:19Z")

</div>

Hi Igor

Thanks for you reply it works perfectly.
