Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


persi
  •  persi
  • Paid support Topic Starter
2016-12-12T17:28:14Z
Hi Everbody,

i have a sql-table about three fields.
I want to send an email to every mailadress in this table, but for instance
to c.birke@test.de all rows with their adress:
474180 29.09.2016
474182 31.12.2016
474100 31.12.2016
After that three rows to "m.pisarek@test.de", and so on...

Can i use "temp"-Variables to store the output?
Please help me. Thanks

KUNDEN_NR GenehmigtBis EMAIL
474180 29.09.2016 c.birke@test.de
474182 31.12.2016 c.birke@test.de
474100 31.12.2016 c.birke@test.de
158828 31.12.2016 m.pisarek@test.de
158900 31.12.2016 m.pisarek@test.de
158976 31.12.2016 m.pisarek@test.de
1350167 31.12.2016 n.kinsel@test.de
1070278 29.07.2016 n.kinsel@test.de
1070508 31.12.2016 s.jaenicke@test.de
474518 31.08.2016 s.kahmann@test.de
912490 31.12.2016 s.kahmann@test.de
Sponsor
Forum information
thomas
2016-12-13T15:44:51Z
Hi

Given that the data is denormalized, there are two ways of doing this that I see, assuming you don't want to use .NET solution

Option 1
a) SELECT DISTINCT email from YourTable. This gives you a list of all emails in VC output
b) Loop through each email and then do a SELECT customerId, Date FROM YourTable WHERE email = 'The email from a)'
c) send email with result from b to email from a

Option 2
a) Select all the data (sorted by email) from you table into VC output
b) Loop through each row and send email when email changes, ie when email in current row <> email in previous row.

Option 1 is probably easier to code, but involves more sql queries. It depends on the size of the table I suppose.

Thomas
persi
  •  persi
  • Paid support Topic Starter
2016-12-13T17:16:37Z
Hi Thomas,

thank you for your answer.
But i haven't do a loop with vc.
How can i use the vc output to loop with a select?

thanks
thomas
2016-12-13T21:15:10Z
Scroll to Top