I have tried unsuccessfully to make this task, but the dataset loop just hangs and I have to stop it.
Here is what I am trying to do:
1) Run a query in the dataset loop as the following: Select MAX(Date_Loaded) from mytablename
2) Assign the results to a variable called DATE_LOADED
3) Send an email to myself every time I run the talk with the DATE_LOADED in the body, or subject I dont care which.
Any ideas?
Kevin
Dataset Loop Hanging
Re: Dataset Loop Hanging
You SQL query returns only one row with one field.
But pay attention that this query should process ALL records in the table.
So, if the table is very large and the field Date_Loaded is not indexed then this query may work very long time.
See my example below. I tested this. It works.
But pay attention that this query should process ALL records in the table.
So, if the table is very large and the field Date_Loaded is not indexed then this query may work very long time.
See my example below. I tested this. It works.
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task617"
Hide=INTEGER|0
ID=INTEGER|1969942530
LogOnAsUser=INTEGER|1
Name=STRING|"MAX date"
OnErrorTaskID=INTEGER|-1
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
Action6=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""ROW"" with value """""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"ROW"
[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""DATE_LOADED"" with value """""
Params=FOLDER
[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"DATE_LOADED"
[Actions\Action3]
ActionID=STRING|"A_LOOP_DATASET"
Enabled=INTEGER|-1
Name=STRING|"Dataset Loop"
Params=FOLDER
[Actions\Action3\Params]
commatext=STRING|"0"
connectionstring=STRING|"Provider=MSDAORA.1;User ID=scott;Data Source=w8r2;Persist Security Info=False"
override=STRING|"1"
password=STRING|"3618932961357733348432447"
sql=STRING|"""select max(hiredate) from emp"""
timeout=STRING|"60"
userid=STRING|"scott"
var2=STRING|"ROW"
withmemo=STRING|"0"
[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""DATE_LOADED"" with value ""{row(0)}"""
Params=FOLDER
[Actions\Action4\Params]
expand=STRING|"1"
varname=STRING|"DATE_LOADED"
varvalue=STRING|"{row(0)}"
[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action6]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER
[Actions\Action6\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"oleg@robotask.com"
host=STRING|"localhost"
html=STRING|"0"
msg0=STRING|"Date_loaded is {Date_Loaded}"
msgcount=STRING|"1"
password=STRING|"2514524685257122493925962"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"New date_loaded"
to=STRING|"oleg@robotask.com"
Oleg Yershov