I have a clean up proceudre that needs to be scheduled on weekly basis. My company owns a schedular that can kick off MS DOS Batch file for me.
If only I can execute the stored procedure from a .BAT file my work will be done.
I tried I created a simple batch file which uses DB2 CLP to execute the stored procedure, but I'm getting this error "SQL1024N A database connection does not exist. SQLSTATE=08003" when I run this batch file.
Batch file contains:
db2cmd -c -w -i db2 connect to DBNAME user ***** using *****
db2cmd -c -w -i db2 call PROCSHEMA.PROCNAME(INARG1, INARG2,?,?,?,?,?) >ProcOutput.txt
Please let me know how I can exstablish a connection or is there any better way to create a bacth file that can do a simple task like executing a procedure.
Any help is greatly appreciated. Thanks