创建ROW_LOV查询

To implement a Row–LOV, create an LOV that selects the primary key

of the row the user wants into a form parameter, and then copy that

value into the primary key field in the results block right before

executing a query.

This example uses the DEPT block, which is based on the DEPT table,

and consists of the three columns DEPTNO, DNAME and LOC. This

table contains a row for each department in a company.

Create a Parameter for Your Primary Key

Create a form parameter(s) to hold the primary key(s) for the LOV. If

the Row–LOV is for a detail block, you do not need a parameter for the

foreign key to the master block (the join column(s)), as you should

include that column in the WHERE clause of your record group in a

later step. Set the datatype and length appropriately.

For example, for the DEPT block, create a parameter called

DEPTNO_QF.

Create an LOV

Create an LOV that includes the columns your user needs to identify

the desired row. If the Row–LOV is for a detail block, you should

include the foreign key to the master block (the join column(s)) in the

WHERE clause of your record group. Return the primary key for the

row into the parameter.

For our example, create an LOV, DEPT_QF, that contains the columns

DEPTNO and DNAME. Set the return item for DEPTNO into

parameter DEPTNO_QF. Although the user sees DNAME , it is not

returned into any field.

Create a PRE–QUERY Trigger

Create a block–level PRE–QUERY trigger (Execution Hierarchy: Before)

that contains:

IF :parameter.G_query_find = ’TRUE’ THEN

:= :parameter.;

:parameter.G_query_find := ’FALSE’;

END IF;

For multi–part keys, you need multiple assignments for the primary

key.

The parameter G_query_find exists in the TEMPLATE form.

For the Dept example, your PRE–QUERY trigger contains:

IF :parameter.G_query_find = ’TRUE’ THEN

:DEPT.DEPTNO := :parameter.DEPTNO_QF

:parameter.G_query_find := ’FALSE’;

END IF;

Create a QUERY_FIND Trigger

Finally, create a block–level user–named trigger QUERY_FIND on the

results block (Execution Hierarchy: Override) that contains:

APP_FIND.QUERY_FIND(’’);

For DEPT:

APP_FIND.QUERY_FIND(’DEPT_QF’);


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/77580/viewspace-212802/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/77580/viewspace-212802/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值