SET myParam = IFNULL(myParam, 0);
Explanation: IFNULL(expression_1, expression_2)
The IFNULL
function returns expression_1
if expression_1
is not NULL
; otherwise it returns expression_2
. The IFNULL
function returns a string or a numeric based on the context where it is used.