Auto SQL Update Jobs States
Previous Topic  Next Topic 

The Auto SQL Update Jobs States command enables you to update the jobs' states in DMS via a predefined SQL script.  This command is the same as selecting the Import | SQL Import | Update Jobs States via SQL manually from the DMS menu.  The SQL script is defined using Import | Import Settings | Update Jobs States SQL Scripts.


In order to update the jobs' states in DMS automatically, the user name provided for the login must have access to the “Enable Auto User Login”. 

The parameter for the automatic import jobs is:


       AutoSQLUpdateJobsStates=command file        


For example, to login to the database WorkData with a user name of Jan Smith to import jobs via an SQL script using the command file C:\Program Files\Dynafact\UpdatesCmd.TXT the following would be used:


"C:\Dynafact\Production\DMS\DMSEnt.exe" "UserIniFolder=C:\Dynafact\Production\DMS\User\" “AutoUserName=Jan Smith” DatabaseName=WorkData “AutoSQLUpdateJobsStates=C:\Program Files\Dynafact\Import Job  UpdatesCmd.TXT"  "AutoLogOut"      


The “command file” is an existing text file that holds the SQL update command information.  The command file parameters must never be surrounded in quotation marks even if the parameter has a space in it.  The following commands are given in the schedule command file: 


  1. SQLScriptName =(The name of the existing DMS SQL script to run)
  2. ReportStatusFilename=(Filename to write the import status and any errors to.  If not given, the default filename of import folder\ ImportJobStatesSQLStatus.TXT will be used.


The following example shows a command file that will run the SQL script "Update Jobs States" and write the import status to a file called "ReportStatusFilename=C:\Program Files\Dynafact\DMS\Export\SomeResults.Txt":


SQLScriptName=Update Jobs States

ReportStatusFilename=C:\Program Files\Dynafact\DMS\Export\SomeResults.Txt