Reputation: 49
What is the difference between dbms_metdata.get_ddl() and user_source table? Both can be used to find the source code from database, as I think. Is any of them better than the other one?
Upvotes: 0
Views: 449
Reputation: 2108
Dbms_metadata.get_ddl reads internal tables like source$ and adds the 'create or replace' part of the DDL statement, and formats it nicely for you to read and execute.
User_source just holds the text of the source, without any formatting or additions to allow execution. You would use this view if you want to search for text within code, for example. So it depends how and what you want to find.
Upvotes: 1