Scheduling sqlexp command

ew25950

New Member
Hello Everyone,
New to progress and I appreciate any help. I need to use proenv to schedule a sqlexp command when nobody is using the application. I can manually do these just fine in test, but I now need to get them scheduled somehow. How are you guys/gals doing this?

We are using:
OpenEdge Release 10.2B05
Windows Server 2012R2

I can use Powershell ISE (start-process "path of Proenv.lnk") while I'm logged in using $wshell.SendKeys. When I schedule that PS script via Windows Task Scheduler the job completes but I know the script didn't run; my -outfile is not created.

Appreciate any help.

Eric
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I need to use proenv to schedule a sqlexp command when nobody is using the application.
If I understand what you are trying to do, I might word the requirement differently: "I need to read data from a database via SQL. I need to do this automatically, on a scheduled basis." Your wording conflates the requirement with the chosen solution (unless someone is forcing you to use sqlexp, and to invoke it from proenv, which would be weird).

I say this not to criticize you but rather to point out that you have options. The sqlexp utility has the benefit that it comes with OpenEdge, so it is always available to you. But if your database is configured for SQL access, and I have to assume it is, you can use any SQL client of your choice. You just need to ensure that the OpenEdge SQL driver is installed on the client machine. The driver comes with the OpenEdge install, and is also available as a separate free* download for use on a machine where you haven't installed OpenEdge.
*free to you, with your product license

The good news: what you want to do can be done easily enough; you don't require Powershell. And you don't need to use proenv. If you look at proenv (%DLC%\bin\proenv.bat), you will see it's just a batch that runs a plain old command prompt with some environment setup. You can do that same setup in your own batch file, and then have it run your desired command (e.g. sqlexp). Or you could make a copy of proenv.bat and add your command to the end of it. It would look something like this:
sqlexp <mydb> -S <my SQL broker port #> -user <myuser> -pass <mypass> -infile infile.sql -outfile outfile.txt where infile.sql contains your SQL command(s) and outfile.txt contains the output from sqlexp.

Once you have it working interactively, you can automate it, e.g. by creating a basic task to run your batch file in Task Scheduler.

We are using:
OpenEdge Release 10.2B05
Windows Server 2012R2
Server 2012 R2 is getting a little long in the tooth. OpenEdge 10.2B05 is very old; it is retired and will never get another bug fix or security patch. (See OpenEdge Product Availability Guides and Life Cycle Guide - Wiki - OpenEdge General - Progress Community.) The powers that be in your organization should really be upgrading to a modern release of OpenEdge. The current vrsion is 12.1 and 12.2 is due to be release within the next two months.
 

ew25950

New Member
Thanks a lot Rob. The application vendor is forcing us to still be on 10.2B05 for now and there are plans to move up to a more recent OS. I was incorrectly using proenv manually because it was working for me. I saw the sqlexp.bat in the bin folder now that I'm looking around more.

Most importantly; as you were sending your reply I was able to get this working "call %dlc%\bin\sqlexp ........" just like I needed via a batch file. Now that the batch file works scheduling it via Task Scheduler is no problem at all.

Many thanks!
 
Last edited:
Top