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!

Apostrophe in DBMS_OUTPUT.PUT_LINE

martin75Dec 12 2007 — edited Dec 13 2007

Following is a script i made for freeing up(SHRINK ing and resetting HWM) the space in Tables and its indexes. I don't know the escape character to use in the DBMS_OUTPUT shown in bold below

create or replace procedure freeup_space
is
type v_segment_type is table of varchar2(30) index by binary_integer;
v_segment v_segment_type;

begin
 select segment_name bulk collect into v_segment
               from user_segments
               where segment_type in ('TABLE')
                 and segment_name not like 'BIN%';

for i in v_segment.first..v_segment.last loop
execute immediate 'alter table ' || v_segment(i) ||' enable row movement';
dbms_output.put_line('Table '||v_segment(i)||'s row movement enabled');
execute immediate 'alter table ' || v_segment(i) ||' shrink space cascade';
end loop;
end;
/

Currently the result will look like
Table EMPs row movement enabled

But i want an apostrophe to be followed after the table name.
Table EMP**'**s row movement enabled

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2008
Added on Dec 12 2007
5 comments
1,019 views