create view dynamic_plan_table AS
  select rawtohex(address) || '_' || child_number statement_id, sysdate timestamp, operation, options, object_node, object_owner, 
      object_name, 0 object_instance, optimizer,  search_columns, id, parent_id, position, cost, cardinality, bytes, other_tag, 
      partition_start, partition_stop, partition_id, other, distribution, cpu_cost, io_cost, temp_space, access_predicates, filter_predicates
  from v$sql_plan
/
select plan_table_output
    from TABLE(dbms_xplan.display('dynamic_plan_table',
    (select rawtohex(s.address)||'_'||s.child_number x from v$sql s, v$session ss 
      where s.address = ss.sql_address and ss.sid = &1),'serial'))
/
drop view dynamic_plan_table
/
