dataset loop values in email body

Discuss RoboTask here
Post Reply
Bedas
Posts: 3
Joined: Wed Jan 18, 2012 1:36 pm
Location: Czech Republic

dataset loop values in email body

Post by Bedas »

Hello, I wonder if you could help me find out what am I doing wrong.I need to get few values from dataset loop and send them via email in its body. But every time I run the loop it stores only the last of the values in variable and when I use this variable in email body I again get only one value.thanks in advanceBedrich
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

dataset loop values in email body

Post by Oleg »

It would be great that you send me your task.
Maybe I can find the problem and advise you something.
Bedas
Posts: 3
Joined: Wed Jan 18, 2012 1:36 pm
Location: Czech Republic

dataset loop values in email body

Post by Bedas »

;*****************************;* RoboTask Task file;* Do not edit in text editor!;***************************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|0CatID=INTEGER|1515828862Comment=STRINGLISTContinueOnError=INTEGER|0ExternalName=STRING|"Task65"Hide=INTEGER|0ID=INTEGER|788314530LogOnAsUser=INTEGER|1Name=STRING|"monitoring jobs"OnErrorTaskID=INTEGER|0Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3WriteGeneralLog=INTEGER|0[Actions]Action1=FOLDERAction2=FOLDERAction3=FOLDERAction4=FOLDER[Actions\Action1]ActionID=STRING|"A_VARIABLES_SET"Enabled=INTEGER|-1Name=STRING|"Set variable ""ORACLE2"" with value ""0"""Params=FOLDER[Actions\Action1\Params]expand=STRING|"1"varname=STRING|"ORACLE2"varvalue=STRING|"0"[Actions\Action2]ActionID=STRING|"A_LOOP_DATASET"Enabled=INTEGER|-1Name=STRING|"Dataset Loop"Params=FOLDER[Actions\Action2\Params]commatext=STRING|"0" connectionstring=STRING|"Provider=MSDASQL.1;Password=xxx;Per sist Security Info=True;User ID=xxx;Data Source=xxx;Mode=Read;Initial Catalog=xxx"override=STRING|"1"password=STRING|"xxx"sql=STRING|"""select id_job from xxx.job"",""where status = 1 and "",""createdon < sysdate-1/48"""timeout=STRING|"60"userid=STRING|"ldp"var2=STRING|"ORACLE2"withmemo=STRING|"0"[Actions\Action3]ActionID=STRING|"A_LOOP_END"Enabled=INTEGER|-1Name=STRING|"End Loop"[Actions\Action4]ActionID=STRING|"A_INET_SENDMAIL"Enabled=INTEGER|-1Name=STRING|"Send Email"Params=FOLDER[Actions\Action4\Params]attachcount=STRING|"0"auth=STRING|"0"from=STRING|"xxx@yyy.com"host=STRING|"xxx"html=STRING|"0"charset=STRING|"windows-1250"msg0=STRING|"{DateTime} "msg1=STRING|"job queue:"msg2=STRING|"{ORACLE2}"msgcount=STRING|"3"password=STRING|"xxx"port=STRING|"xxx"SSL=STRING|"0"subject=STRING|"job in queue"to=STRING|"xxx@yyy.com"
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

dataset loop values in email body

Post by Oleg »

Loop variable ORACLE2 will contain only current value on each iteration. Of course, it should contain only last value after the loop. If you need whole list of ID_job field you should compose the list manually.

See my improvements below:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1076699455
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1142"
Hide=INTEGER|0
ID=INTEGER|1828861422
LocalVariables=STRING|"oracle2,queue"
LogOnAsUser=INTEGER|1
Name=STRING|"monitoring jobs (improved)"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""QUEUE"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"QUEUE"

[Actions\Action2]
ActionID=STRING|"A_LOOP_DATASET"
Enabled=INTEGER|-1
Name=STRING|"Dataset Loop"
Params=FOLDER

[Actions\Action2\Params]
commatext=STRING|"0"
connectionstring=STRING|"Provider=MSDASQL.1;Password=xxx;Per sist Security Info=True;User ID=xxx;Data Source=xxx;Mode=Read;Initial Catalog=xxx"
override=STRING|"1"
password=STRING|"2005621131208762087721131"
sql=STRING|"""select id_job from xxx.job"",""where status = 1 and "",""createdon < sysdate-1/48"""
timeout=STRING|"60"
userid=STRING|"ldp"
var2=STRING|"ORACLE2"
withmemo=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""QUEUE"" with value ""{queue}{oracle2}{eol}"""
Params=FOLDER

[Actions\Action3\Params]
expand=STRING|"1"
varname=STRING|"QUEUE"
varvalue=STRING|"{queue}{oracle2}{eol}"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action5]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER

[Actions\Action5\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"windows-1250"
from=STRING|"xxx@yyy.com"
host=STRING|"xxx"
html=STRING|"0"
msg0=STRING|"{DateTime} "
msg1=STRING|"job queue:"
msg2=STRING|"{queue}"
msgcount=STRING|"3"
password=STRING|"2591326988251992519425711"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"job in queue"
to=STRING|"xxx@yyy.com"
Bedas
Posts: 3
Joined: Wed Jan 18, 2012 1:36 pm
Location: Czech Republic

dataset loop values in email body

Post by Bedas »

yes that works well, thanks a lot
Post Reply