Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Store outline not used in PL/SQL
Is it normal that a stored outline would not be used by SQL that is
contained in a PL/SQL block? I have a query that is a cursor in a PL/
SQL package. I would like to have this query use an outline, but I
can't seem to make it do so. This is 10.2.0.2 on Linux x86_64. I put
together this simple example with an anonymous block that demonstrates
the behavior...
tmx_at_rnetdev> create outline emp on
2 select employee_id from employee where employee_id = :uname;
Outline created.
tmx_at_rnetdev>
tmx_at_rnetdev> select name, sql_text, used from user_outlines where name
= 'EMP';
NAME
SQL_TEXT
USED
EMP select employee_id from employee where employee_id = :uname UNUSED tmx_at_rnetdev> tmx_at_rnetdev> variable uname varchar2(10)tmx_at_rnetdev>
PL/SQL procedure successfully completed.
tmx_at_rnetdev>
tmx_at_rnetdev> alter session set use_stored_outlines = true;
Session altered.
tmx_at_rnetdev> tmx_at_rnetdev> set serveroutput on tmx_at_rnetdev> begin
tmx_at_rnetdev> tmx_at_rnetdev> tmx_at_rnetdev> select name, sql_text, used from user_outlines where name
EMP select employee_id from employee where employee_id = :uname UNUSED
tmx_at_rnetdev>
tmx_at_rnetdev> select employee_id from employee where employee_id
= :uname;
EMPLOYEE_ID
EMP select employee_id from employee where employee_id = :uname USED
Thanks,
Matt
Received on Thu Apr 05 2007 - 16:21:12 CDT