Toad World® Forums

Results from Query in an email: New to Toad and my google-fu has failed me...

Version: 3.8.0.575

I am still very much a greenhorn in regards to Toad Automation, but have been thrown into the lions den at work and have had to learn quickly and Toad World has been an invaluable resource so far.

What I am attempting to do, I feel like, seems easy, but I have struggled to figure out/find a way to do it. I have a scrip that runs and populates a table based on the results of said script. The vb Script is an MS Access macro that looks for files to ensure that the new files have been posted for the current date. The results are added to a table in Access and I have created the connection in Toad.

What I am want to do is query the results in the table and add them to an email.

I do not want them as an attachment, but as a table/variable inside the actual email. When I set up a Variable as SQL, and use:

SELECT * from tbl_Status

I get the following:

To_date(‘10/17/2016 00:00:00.00’, ‘MM/DD/YYYY HH24:MI:SS.SS’)

Edit: The Log shows: Variable “strRecords” set to a result set of 27 row(s)

Any suggestions on how I can achieve this without using attachments?

This should do it…

  1. Add an ‘Execute Script’ action. Under script source select ‘Text’. Enter your query. Select ‘Clipboard’ for Output.

  2. Add an ‘Email’ action - enter required info to send the email, but select ‘Append clipboard contents’ - under ‘Message’ text box.

Side note: Just know that you could potentially run out of space using clipboard contents if your results are long, so it would probably be better to use a file attachment.

[mention:8069324fb35942448c79787c69dfa55f:e9ed411860ed4f2ba0265705b8793d05] thank you very much for the reply. Unfortunately it does not appear I have those options available, unless I am looking in the wrong place.

I also did not see an option to append in the Email Action.

To address your sidenote, this query will never increase in record side, i.e. the chances of it increasing in size is very very little, so I am not afraid of running out of space. Thank you again for your help!

I thought you were referring to Automation Designer in Toad for Oracle. If you are not using Toad for Oracle, then you should post to the appropriate forum. If you are using TFO, then what version are you running. Those options have been in there for a long time, so I think you are referring to some other product.

I see you referred to ‘Version: 3.8.0.575’ - this is not an Toad for Oracle version, so you must be working with another product - Toad for SQL Server or Toad for MySQL possibly. They have their own forums, so I would suggest posting your question there.

Possibly Toad Data Point

From: Dennis Paulus [mailto:bounce-Dennis_Paulus@toadworld.com]

Sent: Monday, October 17, 2016 2:08 PM

To: toadoracle@toadworld.com

Subject: RE: [Toad for Oracle - Discussion Forum] Results from Query in an email: New to Toad and my google-fu has failed me…

RE: Results from Query in an email: New to Toad and my google-fu has failed me…

Reply by Dennis Paulus

I see you referred to ‘Version: 3.8.0.575’ - this is not an Toad for Oracle version, so you must be working with another product - Toad for SQL Server or Toad for MySQL possibly. They have their own forums, so I would suggest posting your question there.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle Forum
notifications altogether.

Toad for Oracle - Discussion Forum

Flag
this post as spam/abuse.

thought you were referring to Automation Designer in Toad for Oracle.

Well yeah, that could be the problem, I apologize, I thought I was in the correct forums, it is Toad Data Point, not TFO. I have marked this as answered as I did not see an option to delete it.

Thank you for taking the time to answer, and again I apologize!

I know you can add single row result variables into an email with just #VariableName# imbedded in the text message. Never tried it with a multirow result.

And this is with Toad Data Point.