ELSIF col.data_type LIKE '%TIMESTAMP%' THEN -- For timestamp columns, convert to a comparable format, e.g., down to seconds v_where_clause := v_where_clause || ' AND NVL(TO_CHAR(A."' || col.column_name || '", ''YYYYMMDDHH24MISS''), '''') = NVL(TO_CHAR(B."' || col.column_name || '", ''YYYYMMDDHH24MISS''), '''')';