Hi,
I'm not a developer but we managed to create a python script produced by Model Builder to automate some daily task. There are some sql statements that need to be run between procedures in the model. Is it possible to call an external sql script from our file to secure the whole process from a single execution? Any help is appreciated...thanks
Solved! Go to Solution.
A simple google search threw up this blog that explains how to call a batch file from within python.
If you want to maintain your workflow as a model then you would write your python code that calls the batch file in the model only calculate value tool. Have a look at help file for that.
How do you normally run you SQL statements? Do you spin up an instance of MS Access and execute it, run it in a custom VB .net console app or manually type it into MySQL?
I usually schedule a batch file that run the sql command thru the command prompt. Our data is in an enterprise geodatabase.
A simple google search threw up this blog that explains how to call a batch file from within python.
If you want to maintain your workflow as a model then you would write your python code that calls the batch file in the model only calculate value tool. Have a look at help file for that.
Thanks Duncan, I'll check it out and let you know how it goes.