Help/Systems SEQUEL Software PowerTech Skybot Software
Help/Systems
The World's Leader in IBM iSeries Software Solutions

Using a Robot/SCHEDULE Enterprise Job to Run a Stored Procedure

Using the SQLCMD command in an agent lets you enter Transact-SQL statements, system procedures, and scripts you want to process.

The example below uses the SQLCMD command in an agent job to execute a script (storeprc.sql). The script contains the steps to execute the stored procedure. Enter this command in the Command Entry tab of your agent job.

sqlcmd -i C:\MyFolder\storeprc.sql -o C:\MyFolder\custordr.txt

When the storeprc.sql script runs, Robot/SCHEDULE Enterprise runs the statements inside the script as follows:

USE ABLE; [where ABLE is the database name]

GO

exec dbo.custorderhist 'vinet'  [This executes the stored procedure custorerhist and passes a parameter of "vinet" for the customer ID.]

GO

 

Updated Nov 16, 2010