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. 平衡树 - Luogu 1486 郁闷的出纳员

    这么久没写平衡树了,再来一发... P1486 郁闷的出纳员 题目描述 OIER公司是一家大型专业化软件公司,有着数以万计的员工.作为一名出纳员,我的任务之一便是统计每位员工的工资.这本来是一份不错的 ...

  2. IOS开发学习笔记028-UITableView单组数据显示代码优化

    1.如果表格中又几百条数据的话,系统会自动加载显示在界面上得数据,逐一加载 添加100个数据到UITableView中 ; i < ; i ++) { NSString *icon = [NSS ...

  3. Mybatis使用-Error attempting to get column 'type' from result set. / '255' in column '4' is outside valid range for the datatype TINYINT.

    一.遇到的问题是这样的: [RemoteTestNG] detected TestNG version 6.9.10log4j: Parsing for [root] with value=[DEBU ...

  4. [python][oldboy][函数篇][1]名称空间

    名称空间:存储名字的空间,分为三种,内置空间,全局空间,局部空间 名称可以是:变量名,函数名,类名等 当遇到一个名字时,首先在自己空间找,再到自己外的空间找 比如 test.py print f # ...

  5. stdlib.h中自带的两个算法qsort,bsearch

    http://zh.cppreference.com/w/c/algorithm ========== void qsort( void *ptr, size_t count, size_t size ...

  6. structs2 对ActionContext valueStack stack context 的理解 图片实例

    structs2 对ActionContext valueStack stack context 的理解 ActionConext : The ActionContext is the context ...

  7. 【bzoj3834】[Poi2014]Solar Panels 数论

    题目描述 Having decided to invest in renewable energy, Byteasar started a solar panels factory. It appea ...

  8. BZOJ3531 [Sdoi2014]旅行 【树剖 + 线段树】

    题目 S国有N个城市,编号从1到N.城市间用N-1条双向道路连接,满足 从一个城市出发可以到达其它所有城市.每个城市信仰不同的宗教,如飞天面条神教.隐形独角兽教.绝地教都是常见的信仰.为了方便,我们用 ...

  9. 【BZOJ 5038 不打兔子】

    Time Limit: 20 Sec  Memory Limit: 256 MBSubmit: 22  Solved: 8[Submit][Status][Discuss] Description 勤 ...

  10. 【WC2019笔记】模拟费用流算法

    在一条数轴上,有 $n$ 只老鼠和 $m$ 个老鼠洞. Q1 每只老鼠都只能往左走,求所有老鼠都进洞的最小代价(代价就是所有老鼠走的距离和). 每个洞只能进一只老鼠. A1 一开始陈江伦老师没说每个洞 ...