I have a Postgres table with a string column carrying numeric values. I need to convert these strings to numbers for math, but I need both NULL values as well as em
NULL
Check if you query parameter is empty (accepts null, empty string or value):
SELECT CAST(TO_JSON(NULLIF(:myParameter, NULL)) AS VARCHAR) IS NULL OR CAST(TO_JSON(NULLIF(:myParameter, NULL)) AS VARCHAR) IN ('""');