Get Source Code of any SQL Object in Oracle

To get the source code of any SQL object in Oracle we can use a standard API(Package-function) DBMS_METADATA.GET_DDL

Syntax:
  dbms_metadata.get_ddl('object_type','object_name')

Example:
  select dbms_metadata.get_ddl('INDEX','SAM_IDX') from dual;

  select dbms_metadata.get_ddl('INDEX','SAM_IDX') from dual;