Example is given below to fetch any Oracle objects DDL script using DBMS_Metadata.Get_DDL command in Oracle Forms using Forms_DDL command.
 
You can download this form for free including source code with following link from Google Drive Dbms_Utility.fmb

You may need to create a table in current schema/user by which you are logging with and below is the script for this:

Create Table DDL_Script (ddl varchar2(1000));

I will add further more tabs related to Dbms utility tasks to this form and will share also.
 
 
Following is the code written in Show DDL push button:
DECLARE
   v        VARCHAR2 (4000);
   objtpe   VARCHAR2 (100);
BEGIN
   --    v := dbms_metadata.get_ddl('TABLE', :objname, user);
   SELECT object_type
     INTO objtpe
     FROM user_objects
    WHERE object_name = :objname;
 
   :objtype := objtpe;
 
   FORMS_DDL ('drop table ddl_script');
   FORMS_DDL(   'create table ddl_script as select dbms_metadata.get_ddl('
             || CHR (39)
             || objtpe
             || CHR (39)
             || ','
             || CHR (39)
             || :objname
             || CHR (39)
             || ', user) ddl from dual');
 
   IF FORM_SUCCESS
   THEN
      SELECT ddl
        INTO :ddltxt
        FROM ddl_script
       WHERE ROWNUM = 1;
   ELSE
      :statbar := 'Message: Object does not exists.';
      FORMS_DDL ('create table ddl_script (ddl varchar2(1000))');
   END IF;
END;
 
Following is the code written in When-new-form-instance trigger:
 
set_window_property(forms_mdi_window, window_state, maximize);
 
DECLARE
   rg_list_id   RECORDGROUP;
   rg_name      VARCHAR2 (20) := 'OBJECTTYPES';
   ret_code     NUMBER;
   --The following holds a SELECT query from which the list elements are derived.
   v_select     VARCHAR2 (300);
BEGIN
   BEGIN
      FORMS_DDL ('drop table ddl_script');
   EXCEPTION
      WHEN OTHERS
      THEN
         NULL;
   END;
 
   BEGIN
      FORMS_DDL ('create table ddl_script (ddl varchar2(1000))');
   EXCEPTION
      WHEN OTHERS
      THEN
         NULL;
   END;
 
   ret_code := POPULATE_GROUP ('OBJECTNAMES');
   POPULATE_LIST ('OBJNAME', 'OBJECTNAMES');
END;
 
You can find the record group details itself in form which I am sharing with this post.

Quick Trick About Using Dbms_Metadata With Forms_DDL In Oracle Forms的更多相关文章

  1. oracle使用dbms_metadata包取得所有对象DDL语句

    当我们想要查看某个表或者是表空间的DDL的时候,可以利用dbms_metadata.get_ddl这个包来查看. dbms_metadata包中的get_ddl函数详细参数 GET_DDL函数返回创建 ...

  2. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  3. Set up gradle HiveMind

    HiveMind is a comprehensive ERP application for service organizations. It includes a project managem ...

  4. 3000本IT书籍下载地址

    http://www.shouce.ren/post/d/id/112300    黑客攻防实战入门与提高.pdfhttp://www.shouce.ren/post/d/id/112299    黑 ...

  5. ocp11g培训内部教材_052课堂笔记(042)_体系架构

    OCP 052 课堂笔记 目录 第一部分: Oracle体系架构... 4 第一章:实例与数据库... 4 1.Oracle 网络架构及应用环境... 4 2.Oracle 体系结构... 4 3. ...

  6. FORM内置系统函数

    abort_query;                                                    停止查询的执行 add_group_column(record grou ...

  7. Deploying Customizations in Oracle E-Business Suite Release 12.2

    DeployingCustomizations in Oracle E-Business Suite Release 12.2 This documentdescribes how to deploy ...

  8. Oracle Metalink Notes Collection

    INV Note 123456.1 Latest 11i Applications Recommended Patch List Note 568012.1:FAQ: Inventory Standa ...

  9. Oracle 11g Articles

    发现一个比较有意思的网站,http://www.oracle-base.com/articles/11g/articles-11g.php Oracle 11g Articles Oracle Dat ...

随机推荐

  1. [软件推荐]转换html到chm的软件,winchm pro

    之前使用teleport pro抓取过好几个网站的内容,网页文件都是在一个文件夹里,但是转换成chm格式的会方便一些. 用过一款软件叫easychm,是国人开发的.但是没注册的版本会在生成的文件中自动 ...

  2. an'gularjs 环境搭建之NodeJS、NPM安装配置步骤(windows版本)

    NodeJS.NPM安装配置步骤(windows版本)  :http://xiaoyaojones.blog.163.com/blog/static/28370125201351501113581/ ...

  3. JAVA 集合List,数组,Set,Map,直接的相互转换

    Java集合转换[List<-->数组.List<-->Set.数组<-->Set.Map-->Set.Map-->List] //List--> ...

  4. vm克隆虚拟机网络配置

    *CentOS虚拟机网络连接方式为:桥接模式* 虚拟机克隆后会导致网络连接不上:(引起原因是新的MAC和网卡配置对应不上)问题解决(在克隆机里执行下列步骤): vi /etc/udev/rules.d ...

  5. PHP最原始的上传文件函数

    <?php $upload_file=$_FILES['upload_file']['tmp_name']; $upload_file_name=$_FILES['upload_file'][' ...

  6. 还原数据库,恢复SQLSERVER登录名的问题

    还原SQLSERVER数据库,原来的数据库的于当前SQLSERVER同名用户就不能再登录了,原因是当前SQLSERVERD的master数据库的sysxlogins表的的sid与还原后的数据库的sys ...

  7. 《深度探索C++对象模型》3

    第六章:执行期语意学 全局对象的初始化: 局部静态对象的初始化: 构建对象数组的vec_new()函数: 针对数组的new操作: placement operator new: 反聚合提高效率: 模板 ...

  8. python基础使用

    Python 标识符 在python里,标识符有字母.数字.下划线组成. 在python中,所有标识符可以包括英文.数字以及下划线(_),但不能以数字开头. python中的标识符是区分大小写的. 以 ...

  9. [原创]南水之源A*(A-Star)算法

    开发导航之前我看了一些A*(A-Star)算法的例子和讲解.没有求得甚解!不过也从A*(A-Star)算法中得到启发,写了一套自己的A*(A-Star)算法.当然,这不是真正(我也不知道)的A*(A- ...

  10. 【转】身份证号码校验与信息提取 - Java 代码

    转载地址:http://www.w3china.org/blog/more.asp?name=lhwork&id=19148 import java.util.regex.*;   /**   ...