phone_number

/*
Parses oracle flex phone numbers of formatting postfix
*/

{% macro phone_number(column_name) %}

    case
        when charindex(CHAR(10), {{ column_name }}, 1) > 0 then
             left({{ column_name }}, charindex(CHAR(10), {{ column_name }}, 1) -1)
        else {{ column_name }}
    end

{% endmacro %}