Code like this does not tell us they are numbers, it tells that first variable has a type like column new_value in history table, and the second variable has a type like old_value in history table.
new_value_l history.new_value%TYPE;
old_value_l history.old_value%TYPE;
So, you need to:
- Ensure that both of these columns have the same datatype, VARCHAR2
- Sometimes errors appear in a line, while actual error is in next or previous line, so you have to check them too
Try to check there is no spaces stored in values by using trim
... ELSIF trim(old_value_l) != trim(new_value_l) ...
I think you have to handle null values too.
... ELSIF trim(old_value_l) != trim(new_value_l) ...