TDWMAssignWD Function | Application Programming Reference | Teradata Vantage - TDWMAssignWD - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantageā„¢

Purpose

Changes the workload a session or request it is assigned to.

Definition

REPLACE FUNCTION TDWM.TDWMAssignWD
  (HostId     SMALLINT,
   SessionNo  INTEGER,
   VprocNo    INTEGER,
   Scope      VARCHAR(1),
   WDId       INTEGER
   )
RETURNS INTEGER
          .
          .
          .
;

Input Parameters

Input Parameter Description
HostId ID of the host upon which the session was issued. HostId cannot exceed 1023. A hostid of zero identifies the database operator console.
SessionNo Session number. SessionNo combined with HostId produces a unique session ID.
VprocNo PE Vproc number where the session runs.
Scope Scope of the change defined:
  • R = Change the workload of the current request
  • S = Change the workload of the session
WDId WD ID to which the request should be assigned.

Usage Notes

If TASM Workloads are not enabled and if the database cannot find a valid host ID and session number combination, an error message is returned.

The TDWMAssignWD function provides similar functionality to a TDWM WD ASSIGNMENT request. For more information about this interface, see TDWM WD ASSIGNMENT.

Return Value

This function returns a zero if it is successful.

Example: Using TDWMAssignWD

SELECT TDWM.TDWMAssignWD(Hostid, sessionNo, runvprocno, 'S', 7)
FROM TABLE (MonitorSession(1,'*',0)) AS t1
where username='user14';
 *** Query completed. 5 rows found. One column returned.
 *** Total elapsed time was 2 seconds.
TDWMAssignWD(HostId,SessionNo,RunVprocNo,'S',7)
----------------------------------------------
                                             0
                                             0
                                             0
                                             0
                                             0