To_date(NULL) in Procedures


I have come across the following issue: to_date() function call with a NULL argument value e.g. to_date(NULL, ‘DD.MM.YYYY’) raises an exception when called in a stored procedure.


However, in a simple select it produces a NULL value instead

Is there a way to achieve the same behaviour in a stored procedure?


It turned out to be my bad. I mistakenly interpreted ‘null’ string as an actual NULL value, which happened when I did not put $ before the field name to actually extract it from a JSON string, rather than refer to it by column.