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!

Anonymous Block Source Code

910971Jul 5 2012 — edited Jul 7 2012
How can I query/access the source code of an anonymous block? For instance, if I want the source of a particular procedure, it's accessible from the "all_source" table. Even if it throws away the source for an anonymous block after it's done with it, it still needs to store it somewhere while it's parsing/executing, so it should at the very least be accessible within the scope of the block like so:
declare
    src_code varchar2;
begin
    select source
    into   src_code
    from   wherever the DB stores it;

    dbms_output.put_line(src_code);
end;
This post has been answered by MichaelS on Jul 5 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2012
Added on Jul 5 2012
19 comments
1,674 views