Synopsis
Returns the value and comment (for most RDBMS) of a WhereScape RED metadata Parameter.
Description
Returns the value and comment (for most RDBMS) of the specified parameter from the DSS_PARAMETER metadata table. For SQL Server, Teradata, and DB2 this routine is a PROCEDURE that returns both the parameter value and comment. However, for Oracle this routine is a FUNCTION that only returns the parameter value. For SQL Server, there is also a WsParameterReadF FUNCTION.
Typically, this routine is used by procedures to read information that is written by another process (automatically or manually via the RED Tools > Parameters menu item), which is external to the procedure.
Input
Input | Description |
---|---|
Parameter Name | The case-sensitive name of the WhereScape RED metadata parameter to be retrieved. The name must exactly match an existing parameter, otherwise a NULL value is returned. |
Output
Output | Description |
---|---|
Parameter Value | The retrieved value of the parameter. Corresponds to the "Value" property that is visible and maintainable via Tools > Parameters. |
Parameter Comments | The maximum number of versions to retain for each object. If 5 is specified then the last 5 versions are retained per object regardless of the specified maximum age to retain. |
SQL Server
SQL Server Parameters: WsParameterRead
Callable Routine Type: PROCEDURE.
Parameter Name | Datatype | Mode |
---|---|---|
@p_parameter | VARCHAR(64) | IN |
@p_value | VARCHAR(2000) | OUT |
@p_comment | VARCHAR(256) | OUT |
Note
There is also a corresponding WsParameterReadF FUNCTION available for SQL Server.
SQL Server Examples: WsParameterRead
DECLARE @v_current_date varchar(4000) – Same length as DSS_PARAMETER.dss_parameter_value. DECLARE @v_comment varchar(256) EXEC WsParameterRead 'CURRENT_DATE', @v_current_date OUTPUT, @v_comment OUTPUT;
Teradata
Teradata Parameters: WsParameterRead
Callable Routine Type: PROCEDURE.
Parameter Name | Datatype | Mode |
---|---|---|
p_parameter | VARCHAR(64) | IN |
p_value | VARCHAR(2000) | OUT |
p_comment | VARCHAR(256) | OUT |
Teradata Examples: WsParameterRead
DECLARE v_current_date varchar(4000); – Same length as DSS_PARAMETER.dss_parameter_value. DECLARE v_comment varchar(256); CDATA[CALL [METABASE].WsParameterRead('CURRENT_DATE',v_current_date,v_comment);
Oracle
Oracle Parameters: WsParameterRead
Callable Routine Type: FUNCTION.
Parameter Name | Datatype | Mode |
---|---|---|
v_parameter | VARCHAR2 | IN |
FUNCTION Return Value | VARCHAR2 | OUT-Function |
Oracle Examples: WsParameterRead
v_current_date varchar2(4000); – Same length as DSS_PARAMETER.dss_parameter_value. v_current_date := WsParameterRead('CURRENT_DATE'); – NOTE: Does NOT support comment output.
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); [CDATA[CALL [METABASE].WsParameterReadG('$$SOURCE_TABLE', p_job_id, p_task_id, v_source_name);