Look at my example, please (see below)
You can collect data in some variable and the write it to text file
Of course you have to specify your own
connection string in the step #2 (
dataset loop)
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1040932817
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task325"
Hide=INTEGER|0
ID=INTEGER|-586330382
LogOnAsUser=INTEGER|1
Name=STRING|"export SQL"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
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 ""TXT"" with value """""
Params=FOLDER
[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"TXT"
[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;Persist Security Info=False;Data Source=mytest"
override=STRING|"0"
paramcount=STRING|"0"
password=STRING|"2005621131211342036418828"
sql=STRING|"""SELECT DISTINCT "",""REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(account0.telephone1, ' ', ''),'-',''),'(',''),')',''),'/',''),'\',''),'+490','+49'),'+49+49','+49') AS phone"",FROM,""FilteredAccount AS account0 "",""WHERE "",""(account0.telephone1 IS NOT NULL)"""
timeout=STRING|"60"
var2=STRING|"ROW"
withmemo=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value ""{txt}{row}{eol}"""
Params=FOLDER
[Actions\Action3\Params]
expand=STRING|"1"
varname=STRING|"TXT"
varvalue=STRING|"{txt}{row}{eol}"
[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action5]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file C:\temp\export.txt"
Params=FOLDER
[Actions\Action5\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"C:\temp\export.txt"
line0=STRING|"{txt}"
linecount=STRING|"1"
suppress=STRING|"0"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.