15.10 - TDWMAssignWD - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

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

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

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.

    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” on page 381.

    This function returns a zero if it is successful.

    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