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. Dcgpofix

    TechNet Library Windows Server Windows Server 2012 R2 and Windows Server 2012 Management and Tools C ...

  2. activemq 简单聊天

    有兴趣加群qq:200634530

  3. web自动化测试:watir+minitest(一)

    基本介绍: 本课程的测试环境和工具为:win7+ruby+watir+minitest Watir 全称是"Web Application Testing in Ruby".它是一 ...

  4. tail /grep/more

    1.tail -f 文件名 不断的刷新日志信息,实时的得到新追加到文件中的信息,常用来跟踪日志文件,如tail -f err.log Ctrl+C退出 2.grep '内容' 文件名 3.more 分 ...

  5. AngularJs 特性 之 双向数据绑定

    <!DOCTYPE html> <html lang="en" ng-app> <head> <meta charset="UT ...

  6. (转)对称加密与非对称加密,以及RSA的原理

    一 概述 二对称加密和非对称加密 对称加密 非对称加密 区别 三RSA原理 整数运算 同余运算 当模数为合数n时 当模数为质数p的时候 离散对数问题 RSA原理 一 , 概述 在现代密码学诞生以前,就 ...

  7. 【bzoj2527】[Poi2011]Meteors 整体二分+树状数组

    题目描述 有N个成员国.现在它发现了一颗新的星球,这颗星球的轨道被分为M份(第M份和第1份相邻),第i份上有第Ai个国家的太空站. 这个星球经常会下陨石雨.BIU已经预测了接下来K场陨石雨的情况.BI ...

  8. BZOJ 1975 魔法猪学院(A*+手写堆)

    1975: [Sdoi2010]魔法猪学院 Time Limit: 10 Sec  Memory Limit: 64 MB Submit: 1941  Solved: 595 [Submit][Sta ...

  9. kubeadm安装k8s测试环境

    目标是搭建一个可测试的k8s环境,使用的工具 kubeadm, 最终一个master节点(非高可用),2个node节点. 环境以及版本 Centos7.3 kubeadm 1.11.1 kubelet ...

  10. 企鹅的游戏(penguin)

    企鹅的游戏(penguin) 题目描述 Shiva养了一只小企鹅.小企鹅很聪明,她总是帮Shiva和他的好朋友想出很多很好玩的游 戏.其中有一个游戏特别经典,Shiva和他的小伙伴们百玩不厌. 游戏规 ...