zoukankan      html  css  js  c++  java
  • 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):

    Download

    clip_image001


    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.

     

  • 相关阅读:
    Openflow1.3
    10行Python代码实现人脸定位
    Ubuntu安装Docker
    docker 命令部分
    tf.truncated_normal和tf.random_normal使用方法的区别
    Tensorboard服务激活
    Tensorflow基础
    TFRecords转化和读取
    卷积层+池化层的理解
    TensorFlow实现LeNet5模型
  • 原文地址:https://www.cnblogs.com/quanweiru/p/6219402.html
Copyright © 2011-2022 走看看