Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Stored Outline Creation script for review

SM_308Jul 30 2008 — edited Jul 31 2008

DB version:10gR2

I am new to stored Outlines and I've been asked to review a Stored Outline Creation script. This is the script

-- Log in as SYS
-- Grant necessary privileges to the User executing SQL in question.

grant create any outline to rec_sch
/
grant execute on dbms_outln to rec_sch
/
grant execute on dbms_outln_edit to rec_sch
/

-- Connect to that user(rec_sch) to create the outline

select name, category, used, sql_text   from  dba_outlines;

ALTER SESSION SET NLS_DATE_FORMAT='DD-MON-YYYY';

alter session set create_stored_outlines = TRUE;

declare
v_sqlstring varchar2(5000);
begin

v_sqlstring:= 'The SQL in Question';

execute immediate v_sqlstring;

end;
/

--After granting the UPDATE privilege on the outln.ol$ table to rec_sh user
--log in as rec_sh

alter session set create_stored_outlines = FALSE;

ALTER SYSTEM set use_stored_outlines = default;

update <font color="red"><b>outln.ol$</b></font>
set sql_text ='The SQL in Question';

Is this script Ok?

Message was edited by:
user609308

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2008
Added on Jul 30 2008
0 comments
217 views