Copy Records From One Data Block To Another Data Block In Oracle Forms
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):
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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ( ...
- 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 ...
- 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, ...
- 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 ...
- block传值以及利用block封装一个网络请求类
1.block在俩个UIViewController间传值 近期刚学了几招block 的高级使用方法,事实上就是利用block语法在俩个UIViewController之间传值,在这里分享给刚開始学习 ...
随机推荐
- WCF,WebServices,WebApi区别
http://www.cnblogs.com/hetring/p/4493137.html
- [oldboy-django][6其他]备份数据库和导入数据库
# 备份数据库 - 简单备份 mysqldump -uroot -pec494904 ecmangent-mobile > /tmp/backfile.sql 表结构+数据 - --opt my ...
- 学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用利用条件运算符的嵌套来完成此题:C表示。
# -*- coding: utf8 -*- # Author:wxq #python 2.7 #题目:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用利用条件运算符 ...
- MFC之HTTP文件上传
BOOL UploadFile(LPCTSTR strURL, LPCTSTR strLocalFileName) { // 如果URL为空或者文件不存在,直接返回 if (strURL == NUL ...
- AngularJs 特性 之 模块化
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- [ZZOJ#31]类欧几里得
[ZZOJ#31]类欧几里得 试题描述 这是一道模板题. 给出 \(a, b, c, n\),请你求出 \(\sum_{x=0}^n{\lfloor \frac{a \cdot x + b}{c} \ ...
- Android jni 编程入门
本文将介绍如何使用eclipse和ndk-build来编写一个基于Android4.4版本的包含有.so动态库的安卓程序. 前提是已经安装和配置好了诸如SDK,NDK等编译环境.下面开始编程! 1 程 ...
- Date()和new Date()区别
当任意一个普通函数用于创建一类对象时,它就被称作构造函数,或构造器. new操作符来调用一个构造函数时,创建一个空对象obj, 将这个空对象的__proto__成员指向了构造函数对象的prototyp ...
- CODEVS【3372】选学霸
题目描述 Description 老师想从N名学生中选M人当学霸,但有K对人实力相当,如果实力相当的人中,一部分被选上,另一部分没有,同学们就会抗议.所以老师想请你帮他求出他该选多少学霸,才能既不让同 ...
- C#.NET中使用存储过程的方法及其优点
原文发布时间为:2008-09-26 -- 来源于本人的百度文章 [由搬家工具导入] 一.使用存储过程的优点 作为服务器端的代码,存储过程具有以下优点:1) 存储过程是预先编译过的,是执行查询或 ...
