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';
Result:
*** 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