A Script I Use That Lets Me See Execution Plan for Whatever is in sqlplus Buffer Without Losing Cont

Comments
-
Why not use dbms_xplan.display in 9 and 10g ?
SQL> set pages600
SQL> set linesize132
SQL> desc my_emp_table;
Name Null? Type
------------------------------------------------------------------------ -------- -------------------------------------------------
EMPLID NOT NULL NUMBER
EMPNAME VARCHAR2(20)
GENDER VARCHAR2(2)SQL> select empname, gender from my_emp_table where emplid=3;
EMPNAME GE
-------------------- --
Larry Ellison MSQL> explain plan for select empname, gender from my_emp_table where emplid=3;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3612125637----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 19 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| MY_EMP_TABLE | 1 | 19 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------------Predicate Information (identified by operation id):
---------------------------------------------------1 - filter("EMPLID"=3)
13 rows selected.
SQL>
0 -
Thanks for sharing 'one another' approach.0