Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_XPLAN.DISPLAY in PL/SQL?

Re: DBMS_XPLAN.DISPLAY in PL/SQL?

From: Alberto Dell'Era <alberto.dellera_at_gmail.com>
Date: 17 Nov 2004 02:39:22 -0800
Message-ID: <4ef2fbf5.0411170239.2e2aa886@posting.google.com>


idogan_tech_at_yahoo.com (Ibrahim DOGAN) wrote in message news:<6bf58828.0411161547.3e077fd4_at_posting.google.com>...

> is there a way to call DBMS_XPLAN.DISPLAY within a pl/sql procedure ? if so how?

Yes, casting it as a table is one way:

begin
  for i in (select plan_table_output from table (dbms_xplan.display))   loop
    dbms_output.put_line (i.plan_table_output);   end loop;
end;
dellera_at_ORACLE9I> /



| Id | Operation | Name | Rows | Bytes | Cost |

| 0 | SELECT STATEMENT | | | | |
| 1 | SORT AGGREGATE | | | | |
| 2 | MERGE JOIN | | | | |
| 3 | SORT JOIN | | | | |
| 4 | TABLE ACCESS FULL| U | | | |
|*  5 |    SORT JOIN         |             |       |       |       |

| 6 | TABLE ACCESS FULL| T | | | |
--------------------------------------------------------------------
(snip)

hth
Alberto Dell'Era Received on Wed Nov 17 2004 - 04:39:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US