Synopsis
Returns the value of a "global" WhereScape RED metadata Parameter that relates to a load table.
Description
Returns the value of an internal parameter that is defined and populated by WhereScape RED, which is available to a procedure that is currently processing a load table.
The supported parameters are $$TABLE_NAME and $$SOURCE_TABLE.
Input
Input | Description |
---|---|
Global Parameter Name | The supported global parameters are:
Note Typically, a Load Table has a single Source Table but if it has multiple sources then the maximum (alphabetically) Source Table Name will be returned. |
Job Identifier | Unique identifier of the held or scheduled job that the running job is a specific instance of. When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument. When invoked manually or externally to the WhereScape RED Scheduler, it is recommended to use 0 (zero). |
Task or Object Identifier | Unique identifier of the running task (of a running job) that executed the routine. When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument. When invoked manually or externally to the WhereScape RED Scheduler, it should be the object key. |
Output
Output | Description |
---|---|
Result Table Name | The requested Load Table Name or Source Table Name. |
SQL Server
SQL Server Parameters: WsParameterReadG
Callable Routine Type: FUNCTION.
Parameter Name | Datatype | Mode |
---|---|---|
@p_parameter | VARCHAR(64) | IN |
@p_job_id | INTEGER | IN |
@p_task_id | INTEGER | IN |
FUNCTION Return Value | VARCHAR(4000) | OUT-Function |
SQL Server Examples: WsParameterReadG
– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure. DECLARE @p_job_id integer DECLARE @p_task_id integer DECLARE @v_source_name varchar(64) SELECT @v_source_name = dbo.WsParameterReadG('$$SOURCE_TABLE', @p_job_id, @p_task_id) – Needs dbo.
Teradata
Teradata Parameters: WsParameterReadG
Callable Routine Type: PROCEDURE.
Parameter Name | Datatype | Mode |
---|---|---|
p_parameter | VARCHAR(64) | IN |
p_job_id | INTEGER | IN |
p_task_id | INTEGER | IN |
p_value | VARCHAR(2000) | OUT |
Teradata Examples: WsParameterReadG
– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure. DECLARE p_job_id integer; DECLARE p_task_id integer; DECLARE v_source_name varchar(256); CALL [METABASE].WsParameterReadG('$$SOURCE_TABLE', p_job_id, p_task_id, v_source_name);
Oracle
Oracle Parameters: WsParameterReadG
Callable Routine Type: FUNCTION.
Parameter Name | Datatype | Mode |
---|---|---|
p_parameter | VARCHAR2 | IN |
p_job_id | NUMBER | IN |
p_task_id | NUMBER | IN |
FUNCTION Return Value | VARCHAR2 | OUT-Function |
Oracle Examples: WsParameterReadG
– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure. p_job_id number; p_task_id number; v_source_name varchar2(64); v_source_name := WsParameterReadG('$$SOURCE_TABLE', p_job_id, p_task_id);
DB2
DB2 Parameters: WsParameterReadG
Callable Routine Type: PROCEDURE.
Parameter Name | Datatype | Mode |
---|---|---|
p_parameter | VARCHAR(64) | IN |
p_job_id | INTEGER | IN |
p_task_id | INTEGER | IN |
p_value | VARCHAR(2000) | OUT |
DB2 Examples: WsParameterReadG
– The p_ VARIABLES are normally PARAMETERS in a RED-generated Procedure. DECLARE p_job_id integer; DECLARE p_task_id integer; DECLARE v_source_name varchar(256); CALL [METABASE].WsParameterReadG('$$SOURCE_TABLE', p_job_id, p_task_id, v_source_name);