Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    41

    Unanswered: db2 task scheduler

    I need to set up DB2 Task Scheduler in order to run some scheduled tasks. I can do it OK via the Task Control Center in 9.7 but our prod system is on v10.1 and the task center does not come with this version. It comes with Data Studio.

    Can someone point me in the right direction of how to set this up correctly via the command line ?

    Code:
    CALL SYSPROC.ADMIN_TASK_ADD(
    'EXPORT',
        NULL,
        NULL,
        NULL,
        '0 0 * * *',
        'SCHEMA1',
        'EXPORT',
        NULL,
        NULL,
        NULL)
        
      CREATE PROCEDURE EXPORT()
    	SPECIFIC EXPORT
      	LANGUAGE SQL
      	BEGIN
    EXPORT TO SCHEMA1.TABLE1.ixf of ixf messages SCHEMA1.TABLE1.txt SELECT * FROM SCHEMA1.TABLE1;
    EXPORT TO SCHEMA2.TABLE2.ixf of ixf messages SCHEMA2.TABLE2.txt SELECT * FROM SCHEMA2.TABLE2;
    END
    Bascially is it possible to avoid using stored procedures ?
    I would prefer to have the export syntax within the input parameters of the admin_task_add function

    Also - as the export commands have 2 different schemas will this effect only having 1 schema name in the task_add function ?

    Is my syntax correct for the stored procedure ?

    Thanks in advance

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    The ATS uses Stored Procedures, so you stuck with that. The syntax of your SP is invalid. You cannot treat EXPORT like it is SQL (it is a command, not SQL). You will have to use ADMIN_CMD: IBM DB2 9.7 for Linux, UNIX and Windows Information Center

    Andy

  3. #3
    Join Date
    Aug 2012
    Posts
    41
    thanks for the response ARWinner !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •