/* ************************************************ */
/*                                                  */
/* fnctn:   Format the qep for the sql statement    */
/*                                                  */
/* name:    @C:\rkupcuna05_ora\Oracle\SQL\qep_3a.sql               */
/* date:    2009-Oct-10                               */
/* creator: Rick Kupcunas                           */
/*                                                  */
/* ************************************************ */

spool qep_3a.rslt;

select decode(id,0, '',
    LPAD(' ',2*(LEVEL-1))||level||'.'||position)||' '||
    operation||' '||options||' '||object_name||' '||
    object_type||' '||
    DECODE(id, 0 ,'Cost = '||position) "Query Plan"
        from PLAN_TABLE1
    connect by prior id = parent_id and 
        statement_id = 'RWK'
    start with id = 0 and statement_id = 'RWK';
        

spool off;










