def get_categories_ids_by_category_type(conn, category_type_id):
    if (is_conn(conn) and is_int(category_type_id)):
        cursor = conn.cursor()
        cursor.execute('SELECT [Id] FROM dbo.Categories where CategoryType=?', category_type_id)
        rows = cursor.fetchall()
        arr = array.array('i')
        for row in rows:
            category_id = row[0]
            arr.append(category_id)
        return arr
    else:
        raise AttributeError('Connection object or Category Type ID                 was not provided')
def get_categories_ids_by_category_type(conn, category_type_id):
    if (is_conn(conn) and is_int(category_type_id)):
        cursor = conn.cursor()
        cursor.execute('SELECT [Id] FROM dbo.Categories where CategoryType=?', category_type_id)
        rows = cursor.fetchall()
        arr = array.array('i')
        for row in rows:
            category_id = row[0]
            arr.append(category_id)
        return arr
    else:
        raise AttributeError('Connection object or Category Type ID                 was not provided')