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. 手把手教你启用RemoteFX以及Hyper-V GPU卸载

    [TechTarget中国原创] 微软的RemoteFX特性可以帮助改善虚拟机图形密集型应用工作负载的性能. 服务器虚拟化已经成熟到大多数工作负载都能够在虚拟机内运行的程度.毫无疑问,与其他工作负载相 ...

  2. Apache shiro学习总结

    Apache shiro集群实现 (一) shiro入门介绍 Apache shiro集群实现 (二) shiro 的INI配置 Apache shiro集群实现 (三)shiro身份认证(Shiro ...

  3. Python学习-day11 RabbitMQ Redis

    这次文章包含两个内容: 1.RabbitMQ使用 2.Redis基础操作 代码部分为练习笔记和作业 概念部分转自Alex老师 RabbitMQ 安装 http://www.rabbitmq.com/i ...

  4. TOJ5272: 逆矩阵

    5272: 逆矩阵  Time Limit(Common/Java):1000MS/3000MS     Memory Limit:65536KByteTotal Submit: 11         ...

  5. windows server 2012 下IIS8.5关于“ 配置错误 不能在此路径中使用此配置节”的解决办法

    服务器升级为windows server 2012 r2后,发布在新装的IIS8.5上的网站不能访问,页面显示“500 - 内部服务器错误.” 在服务器上调试后,提示的错误信息为: 配置错误 不能在此 ...

  6. 【bzoj4066】简单题 KD-tree

    题目描述 你有一个N*N的棋盘,每个格子内有一个整数,初始时的时候全部为0,现在需要维护两种操作: 命令 参数限制 内容 1 x y A 1<=x,y<=N,A是正整数 将格子x,y里的数 ...

  7. hdu 4096 判断路径

    思路:将每个关系当成一条有向边,查询时就判断之间存在路径. #include<iostream> #include<cstdio> #include<cstring> ...

  8. poj 3053 优先队列处理

    Fence Repair Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 39029   Accepted: 12681 De ...

  9. openssl Rsa 分段加密解密

    密钥长度 1024 openssl genrsa -out rsa_private_key.pem openssl rsa -in rsa_private_key.pem -pubout -out r ...

  10. [暑假集训--数论]hdu2136 Largest prime factor

    Everybody knows any number can be combined by the prime number. Now, your task is telling me what po ...