def displayPlan(cursor, iid):
    """
    Query the plan_table table and return the execution plan needed.
    """    
    
    cursor.execute("""SELECT PLAN_TABLE_OUTPUT 
FROM TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE', '{0}','ALL'))""".format(iid))
    return cursor.fetchall()