码迷,mamicode.com
首页 > 数据库 > 详细

Determining Current Block and Current Item in Oracle Forms

时间:2016-12-26 00:22:33      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:creat   developer   rac   use   ble   image   into   win   repr   

SYSTEM.CURSOR_BLOCK

Determining current block in Oracle Forms Using SYSTEM.CURSOR_BLOCK system variable. The value that the SYSTEM.CURSOR_BLOCK system variable represents depends on the current
navigation unit:
If the current navigation unit is the block, record, or item (as in the Pre- and Post- Item, Record, and Block triggers), the value of SYSTEM.CURSOR_BLOCK is the name of the block where the cursor is located. The value is always a character string. If the current navigation unit is the form (as in the Pre- and Post-Form triggers), the value of SYSTEM.CURSOR_BLOCK is NULL.

SYSTEM.CURSOR_BLOCK examples

Assume that you want to create a Key-NXTBLK trigger at the form level that navigates depending on what the current block is. The following trigger performs this function, using :SYSTEM.CURSOR_BLOCK stored in a local variable.

DECLARE
curblk VARCHAR2(30);
BEGIN
curblk := :System.Cursor_Block;
IF curblk = ’ORDERS’
THEN Go_Block(’ITEMS’);
ELSIF curblk = ’ITEMS’
THEN Go_Block(’CUSTOMERS’);
ELSIF curblk = ’CUSTOMERS’
THEN Go_Block(’ORDERS’);
END IF;
END;

SYSTEM.CURSOR_ITEM

Determining current item using System.Cursor_Item in Oracle Forms. SYSTEM.CURSOR_ITEM represents the name of the block and item, block.item, where the input focus (cursor) is located.The value is always a character string.

Usage Notes
Within a given trigger, the value of SYSTEM.CURSOR_ITEM changes when navigation takes place. This differs from SYSTEM.TRIGGER_ITEM, which remains the same from the beginning to the end of single trigger.

SYSTEM.CURSOR_ITEM examples
Assume that you want to create a user-defined procedure that takes the value of the item where the cursor is located (represented by SYSTEM.CURSOR_VALUE), then multiplies the value by a constant, and then reads the modified value into the same item. The following user-defined procedure uses the COPY built-in to perform this function.
 
PROCEDURE CALC_VALUE IS
new_value NUMBER;
BEGIN
new_value := TO_NUMBER(:System.Cursor_Value) * .06;
Copy(TO_CHAR(new_value), :System.Cursor_Item);
END;

View Oracle Developer Handbook at Amazon.com 


技术分享

Determining Current Block and Current Item in Oracle Forms

标签:creat   developer   rac   use   ble   image   into   win   repr   

原文地址:http://www.cnblogs.com/quanweiru/p/6220565.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!