Synopsis
Records a message in the Error/Detail Log.
Description
Adds the specified message to the WS_WRK_ERROR_LOG workflow metadata table, which is referred to as the Error Log or Detail Log. A variety of message types are supported such as Information, Warning, and Error that are included in the "detail" message counts for the task and job (viewable via the "Scheduler" tab/window). Error/Detail Log messages are accessible via the "Scheduler" tab/window and/or the WS_ADMIN_V_ERROR view of the WS_WRK_ERROR_LOG table.

Note

Both the Audit Log and Error/Detail Log support similar information and in user-defined custom procedures, either or both logs can be used. However, in RED-generated procedures/scripts, the Audit Log is used for higher-level or summary messages while the Error/Detail Log is used for more detailed supporting information.

Input

Input

Description

Common Input

Includes all 5 inputs of the Callable Routines Common Input.

Note

Refer to the RDBMS-specific parameters for the relative positions (they are NOT declared as the first parameters).

Error/Detail Message Type Code

Error/Detail Message Type Code:

  • E - Error.
  • I - Information.
  • W - Warning.

Error/Detail Message Text

Custom message text to be recorded in the WhereScape RED Error/Detail Log.

RDBMS Code

RDBMS-specific message code. e.g. The Oracle special variable SQLCODE. It is optional but recommended to populate this when an error occurs.

RDBMS Message

RDBMS-specific message. e.g. The Oracle special variable SQLERRM. It is optional but recommended to populate this when an error occurs.

Custom Message Type Code

Custom Message Type Code. For custom usage and has no meaning within the WhereScape RED metadata.

Output

Output

Description

Result Number

Output Result Number:

  • 1 Success.
  • -3 Error.

SQL Server

SQL Server Parameters: WsWrkError
Callable Routine Type: PROCEDURE.

Parameter Name

Datatype

Mode

@p_status_code

VARCHAR(1)

IN

@p_job_name

VARCHAR(64)

IN

@p_task_name

VARCHAR(64)

IN

@p_sequence

INTEGER

IN

@p_message

VARCHAR(256)

IN

@p_db_code

VARCHAR(10)

IN

@p_db_msg

VARCHAR(256)

IN

@p_task_key

INTEGER

IN

@p_job_key

INTEGER

IN

@p_msg_type

VARCHAR(10)

IN

SQL Server Examples: WsWrkError

– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure.
DECLARE @p_sequence integer
DECLARE @p_job_name varchar(256)
DECLARE @p_task_name varchar(256)
DECLARE @p_job_id integer
DECLARE @p_task_id integer
DECLARE @p_return_msg varchar(256)
DECLARE @p_status integer
DECLARE @v_result_num integer
EXEC @v_result_num = WsWrkError
'I', @p_job_name, @p_task_name, @p_sequence
, 'This is an INFO message in the Error/Detail Log.'
, NULL
, NULL
, @p_task_id
, @p_job_id
, NULL

Teradata

Teradata Parameters: WsWrkError
Callable Routine Type: PROCEDURE.

Parameter Name

Datatype

Mode

p_status_code

VARCHAR(1)

IN

p_job_name

VARCHAR(64)

IN

p_task_name

VARCHAR(64)

IN

p_sequence

INTEGER

IN

p_message

VARCHAR(255)

IN

p_db_code

VARCHAR(10)

IN

p_db_msg

VARCHAR(255)

IN

p_task_key

INTEGER

IN

p_job_key

INTEGER

IN

p_msg_type

VARCHAR(10)

IN

Teradata Examples: WsWrkError

– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure.
DECLARE p_sequence integer;
DECLARE p_job_name varchar(256);
DECLARE p_task_name varchar(256);
DECLARE p_job_id integer;
DECLARE p_task_id integer;
DECLARE p_return_msg varchar(256);
DECLARE p_status integer;
CALL [METABASE].WsWrkError
( 'I', p_job_name, p_task_name, p_sequence
, 'This is an INFO message in the Error/Detail Log.'
, NULL
, NULL
, p_task_id
, p_job_id
, NULL
);

Oracle

Oracle Parameters: WsWrkError
Callable Routine Type: FUNCTION.

Parameter Name

Datatype

Mode

v_status_code

VARCHAR2

IN

v_job_name

VARCHAR2

IN

v_task_name

VARCHAR2

IN

v_sequence

NUMBER

IN

v_message

VARCHAR2

IN

v_db_code

VARCHAR2

IN

v_db_msg

VARCHAR2

IN

v_task_key

NUMBER

IN

v_job_key

NUMBER

IN

v_msg_type

VARCHAR2

IN

FUNCTION Return Value

NUMBER

OUT-Function

Oracle Examples: WsWrkError

– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure.
p_sequence number;
p_job_name varchar2(256);
p_task_name varchar2(256);
p_job_id number;
p_task_id number;
p_return_msg varchar2(256);
p_status number;
v_result_num number;
v_result_num := WsWrkError
( 'I', p_job_name, p_task_name, p_sequence
, 'This is an INFO message in the Error/Detail Log.'
, NULL
, NULL
, p_task_id
, p_job_id
, NULL
);

DB2

DB2 Parameters: WsWrkError
Callable Routine Type: PROCEDURE.

Parameter Name

Datatype

Mode

v_status_code

CHARACTER

IN

v_job_name

VARCHAR(64)

IN

v_task_name

VARCHAR(64)

IN

v_sequence

INTEGER

IN

v_message

VARCHAR(256)

IN

v_db_code

VARCHAR(10)

IN

v_db_msg

VARCHAR(256)

IN

v_task_key

INTEGER

IN

v_job_key

INTEGER

IN

v_msg_type

VARCHAR(10)

IN

DB2 Examples: WsWrkError

– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure.
DECLARE p_sequence integer;
DECLARE p_job_name varchar(256);
DECLARE p_task_name varchar(256);
DECLARE p_job_id integer;
DECLARE p_task_id integer;
DECLARE p_return_msg varchar(256);
DECLARE p_status integer;
CALL [METABASE].WsWrkError
( 'I', p_job_name, p_task_name, p_sequence
, 'This is an INFO message in the Error/Detail Log.'
, NULL
, NULL
, p_task_id
, p_job_id
, NULL
);


  • No labels