In this tutorial you will learn to copy the records from one data block to another data block on same form and on a same canvas in Oracle Forms.

Below is the screen shot of the form and you can download this form for your reference from the following link (Table script is also included):

Download

In the above picture you can see that there are two blocks, first one is the block based on a table and the second one is a non-database data block, but this is not necessary you can make the block based on a table also.

The functionality of this form is, user will select the record above then click on Copy button to copy the record below, it is like making the selection of records from a data block. User can also remove the records from the second block where the records are being copied.

The whole functionality is written on the push button Copy and below is the code written on When-Button-Pressed trigger:

BEGIN

GO_BLOCK ('COPIED');

FIRST_RECORD;

LOOP

-- CHECK THE VALUE IF RECORD IS EMPTY IF NOT THEN JUMP TO ANOTHER

IF :copied.empno IS NULL

THEN

-- EXIT TO COPY THE RECORD

EXIT;

END IF;

-- ELSE CONTINUE FINDING EMPTY RECORD

IF :SYSTEM.LAST_RECORD = 'TRUE'

THEN

CREATE_RECORD;

EXIT;

END IF;

NEXT_RECORD;

END LOOP;

-- COPY THE RECORD

:copied.empno := :scott_emp.empno;

:copied.ename := :scott_emp.ename;

:copied.job := :scott_emp.job;

:copied.mgr := :scott_emp.mgr;

:copied.hiredate := :scott_emp.hiredate;

:copied.sal := :scott_emp.sal;

:copied.comm := :scott_emp.comm;

:copied.deptno := :scott_emp.deptno;

-- GO BACK TO FIRST BLOCK

GO_BLOCK ('SCOTT_EMP');

END;

You should replace the value of data block and item reference (:copied.empno := :scott_emp.empno) with your form's data block and items.

Below is the code of Remove push button of second data block to clear the record when pressed:

CLEAR_RECORD;

Just a One line code which is sufficient.

Copy Records From One Data Block To Another Data Block In Oracle Forms的更多相关文章

  1. Moving From Top To Bottom in Detailed Block in Oracle Forms

    Suppose you want to scan a tabular grid block (loop through all records in detail block) from top to ...

  2. Create Stacked Canvas to Scroll Horizontal Tabular Data Blocks In Oracle Forms

    In this tutorial you will learn to create horizontal scrollable tabular or detail data block by usin ...

  3. Populating Tabular Data Block Manually Using Cursor in Oracle Forms

    Suppose you want to populate a non-database data block with records manually in Oracle forms. This t ...

  4. Create Data Block Based On From Clause Query In Oracle Forms

    Example is given below to create a data block based on From Clause query in Oracle Forms. The follow ...

  5. ORA-01578 ORACLE data block corrupted (file # 29, block # 2889087)

    BW数据库后台报错如下:F:\oracle\SBP\saptrace\diag\rdbms\sbp\sbp\trace ORA-01578: ORACLE data block corrupted ( ...

  6. ORA-01578: ORACLE data block corrupted (file # 3, block # 1675)

    警告日志中发现如下报错信息: ORA-01578: ORACLE data block corrupted (file # 3, block # 1675)ORA-01110: data file 3 ...

  7. Checking For User Permissions Before Updating or Inserting The Records in Oracle Forms

    Suppose you want to check the user permissions on inserting or updating the records in Oracle Forms, ...

  8. Create Hierarchical Tree To Control Records In Oracle Forms

    Download Source Code Providing an example form for creating hierarchical trees in Oracle Forms to co ...

  9. block传值以及利用block封装一个网络请求类

    1.block在俩个UIViewController间传值 近期刚学了几招block 的高级使用方法,事实上就是利用block语法在俩个UIViewController之间传值,在这里分享给刚開始学习 ...

随机推荐

  1. laravel5.2总结--服务容器(依赖注入,控制反转)

    1.依赖 我们定义两个类:class Supperman 和 class Power,现在我们要使用Supperman ,而Supperman 依赖了Power class Supperman { p ...

  2. 【Swap Nodes in Pairs】cpp

    题目: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1-> ...

  3. 【原创】React实例入门教程(1)基础API,JSX语法--hello world

    前  言 毫无疑问,react是目前最最热门的框架(没有之一),了解并学习使用React,可以说是现在每个前端工程师都需要的. 在前端领域,一个框架为何会如此之火爆,无外乎两个原因:性能优秀,开发效率 ...

  4. XSS Challenges(1-12关)

    XSS Challenges解析: 1. 什么过滤也没有,而且是直接输出.<scrip>alert(document.domain);</script>即可通过 2. 直接输入 ...

  5. SSM框架 springMVC对静态资源访问的处理

    https://my.oschina.net/hnqingping1255/blog/415575 错误信息 [org.springframework.web.servlet.PageNotFound ...

  6. Unity3D - 设计模式 - 工厂模式

    工厂模式:以食物生产为例 1. 一个生产食物的工厂(此项 需要建立两个类:食物基类<Food>,工厂类<Factory>) 2. 可以生产不同的食物(此项 建立食物的具体子类, ...

  7. 设计模式(一)单例模式:2-懒汉模式(Lazy)

    思想: 相比于饿汉模式,懒汉模式实际中的应用更多,因为在系统中,“被用到时再初始化”是更佳的解决方案. 设计思想与饿汉模式类似,同样是持有一个自身的引用,只是将 new 的动作延迟到 getinsta ...

  8. Codeforces Round #304 (Div. 2) A B C 水

    A. Soldier and Bananas time limit per test 1 second memory limit per test 256 megabytes input standa ...

  9. Codeforces Round #323 (Div. 2) A 水

    A. Asphalting Roads time limit per test 1 second memory limit per test 256 megabytes input standard ...

  10. 数位DP毕业题

    原题 题意 给一个 $64$ 位的二进制数,求小于这个数的回文二进制数的数量. 题解 加强版 题意 同上,但允许一个数最多有 $k$ 位不是回文(即把任意 $k$ 位取反后这个数是一个回文数),这种数 ...