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. CSS 文字阴影(text-shadow)怎么用

    textShadow="1px 1px 1px #ff0000" textShadow="水平位移 垂直位移 模糊半径 阴影颜色"

  2. java中的拷贝(二)深克隆

    浅拷贝(Object类中的clone()方法)是指在拷贝对象时,对于基本数据类型的变量会重新复制一份,而对于引用类型的变量只是对引用进行拷贝. 深拷贝(或叫深克隆) 则是对对象及该对象关联的对象内容, ...

  3. 161122、BOM 操作写法示例

    浏览器相关信息 // 浏览器信息 navigator.userAgent // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/ ...

  4. 调用css时,用link 和 @import url 有什么区别

    加载css link与@import的区别: 其实 link 与 @import 在显示效果上还是有很大区别的,基本上来看 link 的加在会在页面显示之前全部加在完全,而 @import 会是读取完 ...

  5. java 使用反射技术解耦

    1.调用的代码 /src/de/test.java package de; public class Test { public static void main(String[] args) { D ...

  6. python sklearn环境配置

    os:win10   python2.7 主要参照 1.现下载pip.exe,因为很多安装文件都变成whl格式了,这里要注意下载对应python版本的,要用管理员权限,可以参照https://pypi ...

  7. 在CentOS之上搭建VMware Player 7

    1.下载VMware-Player-7.1.2安装包 百度网盘下载地址: 链接:http://pan.baidu.com/s/1nudfo6H 密码:oemc 直接下载地址: https://down ...

  8. require()与 require_once()、 include与include_once()

  9. C#:通过Window API接口实现WiFi

    1.获取Mac地址 //WiFi通知回调 private WlanApi.WLAN_NOTIFICATION_CALLBACK _notificationCallback; this._notific ...

  10. 限制Input输入类型的常见代码集合

    搜集整理常见的限制INPUT输入类型的实现方式: 1.只能输入和粘贴汉字 <input onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g ...