How i run my sql command using batch file and print output of sql command in text file.
–we can use EXECUTE QUERY activity and mention the query like select statement which will give us output of type datatable named dt
to get execute query activity go to design tab -> manage packages -> in official tab search as uipath.database.activities and install it
–now use a GENERATE DATATABLE ACTIVITY and pass the above variable dt as input and get the output with a variable of type string named str_output
–now use a WRITE TEXT FILE activity and pass the variable str_output as input and mention the file path of .txt file
–now use a .bat file and mention the file path of uipathrobot.exe and this project xaml filepath
"C:\Users\example\AppData\Local\UiPath\app-18.1.4\UiRobot.exe” /file “C:\Users\example\Documents\UiPath\Practice\Main.xaml File”
this will run the sql query and store the output of that sql statement to a txt file
can you please share your workflow it will helps us alot.
@Palaniyappan how to mention the path of robot and Xaml file in batch file.
like this buddy
the first path is the filepath of uirobot.exe and second is the main.xaml file path
but the filepath might differ in your system for both uipath.exe file and the xaml file. kindly mention as per your machine
which activity we have to take for executing bat file.
START PROCESS activity where pass the filepath of .bat file as input to FILENAME property of start process activity
@Palaniyappan This will work!!
Else you may also use invoke code activity
Process.Start(pathToBatchFile as String)
Batch file window popups again and again and also not getting output