def get_category_type_id_by_name(conn, category_type_name):
    if (is_conn(conn) and is_str(category_type_name)):
        cursor = conn.cursor()
        category_type_id = (- 1)
        cursor.execute('SELECT id,Typename FROM dbo.CategoriesTypes WHERE TypeName=?', category_type_name)
        rows = cursor.fetchall()
        if (len(rows) > 0):
            for row in rows:
                category_type_id = row[0]
                return category_type_id
        else:
            return category_type_id
    else:
        raise AttributeError('Connection object or Category Name                 was not provided')
def get_category_type_id_by_name(conn, category_type_name):
    if (is_conn(conn) and is_str(category_type_name)):
        cursor = conn.cursor()
        category_type_id = (- 1)
        cursor.execute('SELECT id,Typename FROM dbo.CategoriesTypes WHERE TypeName=?', category_type_name)
        rows = cursor.fetchall()
        if (len(rows) > 0):
            for row in rows:
                category_type_id = row[0]
                return category_type_id
        else:
            return category_type_id
    else:
        raise AttributeError('Connection object or Category Name                 was not provided')