Start of change

THREAD_ID

This global variable contains the thread ID of the current thread.

This global variable has the following characteristics:
  • It is read-only, with values maintained by system.
  • The type is BIGINT.
  • The schema is QSYS2.
  • The scope of this global variable is session.

Example

Capture the thread scoped record locks over the SALES table which are held by the current thread..
SELECT * FROM QSYS2.RECORD_LOCK_INFO L
  WHERE L.TABLE_NAME = 'SALES' AND 
        L.JOB_NAME = QSYS2.JOB_NAME AND
        L.THREAD_ID = QSYS2.THREAD_ID    
End of change