SQL - Scalar functions - SECOND
The SECOND function returns the seconds part of a value with optional fractional seconds.
The schema is SYSIBM.
The result of the function with a single argument is a large integer. The result of the function with two arguments is DECIMAL(2+s,s) where s is the value of the integer-constant. If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.
The other rules depend on the data type of the first argument and the number of arguments:
SELECT SECOND(:TIME_DUR) FROM SYSIBM.SYSDUMMY1
Returns the value 45.
SELECT SECOND(RECEIVED) FROM IN_TRAY
Returns the value 30.
SELECT SECOND (CURRENTTIMESTAMP(3), 3) FROM SYSIBM.SYSDUMMY1
Returns a DECIMAL(5,3) value based on the current timestamp that could be something like 54.321.