ITPub博客

首页 > 数据库 > Oracle > Name_in 的用途?

Name_in 的用途?

原创 Oracle 作者:longwansheng 时间:2007-08-16 22:30:57 0 删除 编辑
Name_in 的用途?[@more@]

FORMS里有一个BUILD_IN的函数NAME_IN, 不太清楚它的作用. 用NAME_IN 和直接用变量有何区别?

如: IF NAME_IN ( :VAR1 ) IS NULL ...
和 IF :VAR1 IS NULL ... 有何不同?

COPY (NAME_IN ( ' :VAR1' ), ' :VAR2 ' );
与 COPY ( ' :VAR1' , ' :VAR2 '); 又有何分别呢?

IF :VAR1 IS NULL ... direct reference
IF NAME_IN ( :VAR1 ) IS NULL ... indirect reference

Referencing items indirectly allows you to write more generic, reusable code. By using variables in place of actual item names, you can write a subprogram that can operate on any item whose name has been assigned to the indicated variable.

If you nest the NAME_IN function, Form Builder evaluates the individual NAME_IN functions from the innermost one to the outermost one.

library is not saved within form. but in different file, so there is no where to find :frm1.txt1

for example, if you have a procedure in library:

procedure p1( v_one varchar2)

name_in(v_one) to get the value inside v_one, that is :frm1.txt1, so:

copy('value', name_in(v_one)) ==> to copy value to the txt field txt1 in form frm1.

you can't use:

copy('value', :frm1.txt1), nor you can:

copy('value', v_one).


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

请登录后发表评论 登录
全部评论

注册时间:2007-12-12

  • 博文量
    162
  • 访问量
    774143