Reputation: 55
I'm looking to see if there is a way to code PB to upload a sql script and to save the output. I know how to code PB by writing the sql directly in it, but I want to program it so I can do something like 'click browse', select .sql file, and save the results in a text file. I've been searching but can't seem to find what I'm looking for. Any guidance would be much appreciated. Thank you.
Upvotes: 0
Views: 282
Reputation: 2397
In a nutshell you can open the desired file, read the contents into a string, use the sql string to create a datastore (see SyntaxFromSql method), execute the sql via a retrieve, then save the results with the SaveAs method.
Upvotes: 2