The procedures managed by the WhereScape RED scheduler require the following standards. If a function or procedure is being developed that is not called directly by the scheduler, then it does not need to conform with this standard. If however, such a procedure or function wants to log messages to the audit or error logs then it needs the input parameters included in its parameter list.

The WhereScape RED procedure editor includes support for syntax highlighting.

Parameters

 The procedure must have the following parameters in the following order:

Parameter name

Input/Output

SQL Server Type

p_sequence

Input

Integer

p_job_name

Input

Varchar(256)

p_task_name

Input

Varchar(256)

p_job_id

Input

Integer

p_task_id

Input

Integer

p_return_msg

Output

Varchar(256)

p_status

Output

Integer

The input parameters are passed to the procedure by the scheduler. If the procedure is called outside the scheduler then the normal practice is to pass zero (0) in the sequence, job_id, and task_id. A description of the run can be passed in the job name and the task name is typically the name of the procedure.
The output parameters must be populated by the procedure on completion. The return_msg can be any string up to 256 characters long that describes the result of the procedures execution. The status must be one of the following values:

Status

Meaning

Description

1

Success

Normal completion

-1

Warning

Completion with warnings

-2

Error

Hold subsequent tasks dependent on this task

-3

Fatal Error

Hold all subsequent tasks

Multiple SQL statements can be separated using the "end of statement" indicator. This is <EOS> by default but can be configured in Home > Options > Code Generation > General.


  • No labels