NVL function is used to replace the NULL values within an expression, shown as follows:
v_total_salary := NVL(v_salary, 0) + NVL(v_bonus,0)
In the preceding statement, the value of v_bonus variable will be taken as 0 in case it has a null value. If the value of v_bonus variable is non-null, then the value is left as it is and not replaced by O.
v_total_salary := NVL(v_salary, 0) + NVL(v_bonus,0)
In the preceding statement, the value of v_bonus variable will be taken as 0 in case it has a null value. If the value of v_bonus variable is non-null, then the value is left as it is and not replaced by O.