Synopsis
Records multiple messages in the Error/Detail Log.
Description
Adds the specified multiple messages 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(s) Text

Custom message(s) text to be recorded in the WhereScape RED Error/Detail Log. Multiple messages can be specified but each is limited to 256 characters. Each message must be separated by either a new-line (ASCII 10) or tilde (~) character. e.g. Message1~Message2~Message3 will create 3 messages.

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

Note

NOT provided for all RDBMS.

Output Result Number:

  • 1   Success.
  • -2  Error.
  • -3  Fatal/Unexpected Error.

SQL Server

SQL Server Parameters: WsWrkErrorBulk
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(4000)

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: WsWrkErrorBulk

– 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 = WsWrkErrorBulk
'I', @p_job_name, @p_task_name, @p_sequence
, 'Message1~Message2~Message3'
, NULL
, NULL
, @p_job_id
, @p_task_id
, NULL

Teradata

Teradata Parameters: WsWrkErrorBulk
Callable Routine Type: PROCEDURE.

Parameter Name

Datatype

Mode

p_status_code

VARCHAR(64)

IN

p_job_name

VARCHAR(64)

IN

p_task_name

VARCHAR(64)

IN

p_sequence

INTEGER

IN

p_message

VARCHAR(61440)

IN

p_db_code

VARCHAR(10)

IN

p_db_msg

VARCHAR(256)

IN

p_job_id

INTEGER

IN

p_task_id

INTEGER

IN

p_msg_type

VARCHAR(10)

IN

p_result

INTEGER

OUT

Teradata Examples: WsWrkErrorBulk

– 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;
CALL [METABASE].WsWrkErrorBulk
( 'I', p_job_name, p_task_name, p_sequence
, 'Message1~Message2~Message3'
, NULL
, NULL
, p_job_id --### NOTE order.
, p_task_id --### NOTE order.
, NULL
, v_result_num
);

Oracle

Oracle Parameters: WsWrkErrorBulk
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: WsWrkErrorBulk

– 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 := WsWrkErrorBulk
( 'I', p_job_name, p_task_name, p_sequence
, 'Message1~Message2~Message3'
, NULL
, NULL
, p_task_id
, p_job_id
, NULL
);

DB2

DB2 Parameters: WsWrkErrorBulk
Callable Routine Type: PROCEDURE.

Parameter Name

Datatype

Mode

p_status_code

VARCHAR(64)

IN

p_job_name

VARCHAR(64)

IN

p_task_name

VARCHAR(64)

IN

p_sequence

INTEGER

IN

p_message

VARCHAR(32672)

IN

p_db_code

VARCHAR(10)

IN

p_db_msg

VARCHAR(256)

IN

p_job_id

INTEGER

IN

p_task_id

INTEGER

IN

p_msg_type

VARCHAR(10)

IN

p_result

INTEGER

OUT

DB2 Examples: WsWrkErrorBulk

– 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;
CALL [METABASE].WsWrkErrorBulk
( 'I', p_job_name, p_task_name, p_sequence
, 'Message1~Message2~Message3'
, NULL
, NULL
, p_job_id --### NOTE order.
, p_task_id --### NOTE order.
, NULL
, v_result_num
);
  • No labels