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

Teradata Vantageā„¢ - Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1090-171K
Language
English (United States)

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

This function returns a zero if it is successful.

Syntax

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

Syntax Elements

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.

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