Created
August 23, 2017 09:36
-
-
Save hemantkchitale/c917d5f2790273de8dc854071049222b to your computer and use it in GitHub Desktop.
Autonomous Comment in Oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set echo on | |
set pages600 | |
set linesize 132 | |
spool create_proc_autonomous_comment_ddl | |
create or replace procedure proc_autonomous_comment_ddl | |
(in_table_name in varchar , in_comment_28char in varchar) | |
is | |
pragma autonomous_transaction; | |
comment_table_name varchar(30); | |
comment_words varchar2(30); | |
command_string varchar(128); | |
begin | |
comment_table_name := in_table_name; | |
comment_words := in_comment_28char; | |
command_string := 'comment on table ' || comment_table_name || ' is ''' || comment_words || '''' ; | |
execute immediate command_string; | |
end; | |
/ | |
show errors; | |
desc proc_autonomous_comment_ddl | |
spool off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be able to issue a COMMENT (a DDL) without actually doing an implicit COMMIT in the current transaction. The COMMENT can invalidate SQLs against the underlying table.