[comp.databases] more ORACLE SQL*FORMS gorey trigger problems

beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) (09/15/90)

I am working with Oracle SQL*FORMS version 2.0. 


In one block-level KEY-ENTQRY trigger I have the following two
steps and they work just fine:


 1) #COPY &SYSTEM.CURRENT_FIELD GLOBAL.curr_aa;
 2) #EXEMACRO CALL &GLOBAL.curr_aa;


So the form that gets called at this point depends on the
value of the variable in GLOBAL.curr_aa. In this 2nd form
that gets called I have as a block level ( I also tried field
level) KEY-EXEQRY trigger the following 2 steps:


  1) #COPY &SYSTEM.CURRENT_FIELD GLOBAL.curr_atom;
  2) #EXEMACRO GOBLK molecule;
and the block MOLECULE has a key trigger :

     #EXEMACRO GOFLD &GLOBAL.curr_aa;


This trigger, which looks very similar to me, seems to be doomed on
two accounts:

   1) Oracle complains that the "&SYSTEM.CURRENT_FIELD" is an ambiguous

field name. It didn't find it ambiguous in the 1st situation. Both blocks being used have more than one column and for each I have the cursor positioned
correctly over the field of interest. If I remove the ampersand:

	  COPY SYSTEM.CURRENT_FIELD GLOBAL.curr_atom


Oracle no longer finds this ambiguous! Is the problem related to the fact
that I'm in a form called by another?????

Secondarily, I don't seem to be able to say

#EXEMACRO GOFLD &GLOBAL.curr_atom, although in the calling form
#EXEMACRO CALL  &GLOBAL.curr_aa; worked no problem.

 Is this problem a difference between how Oracle handles block names and
 form names ( and the corresponding GOFLDs and CALLs) or once again
 could it possibly have to do with nesting level?

 THanks for all the help so far.

tgreenla@oracle.uucp (Terry Greenlaw) (09/18/90)

In article <11268@spool.cs.wisc.edu> beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) writes:
>
>I am working with Oracle SQL*FORMS version 2.0. 
>
>
>In one block-level KEY-ENTQRY trigger I have the following two
>steps and they work just fine:
>
>
> 1) #COPY &SYSTEM.CURRENT_FIELD GLOBAL.curr_aa;
> 2) #EXEMACRO CALL &GLOBAL.curr_aa;
>
>
>So the form that gets called at this point depends on the
>value of the variable in GLOBAL.curr_aa. In this 2nd form
>that gets called I have as a block level ( I also tried field
>level) KEY-EXEQRY trigger the following 2 steps:
>
>
>  1) #COPY &SYSTEM.CURRENT_FIELD GLOBAL.curr_atom;
>  2) #EXEMACRO GOBLK molecule;
>and the block MOLECULE has a key trigger :
>
>     #EXEMACRO GOFLD &GLOBAL.curr_aa;
>
>
>This trigger, which looks very similar to me, seems to be doomed on
>two accounts:
>
>   1) Oracle complains that the "&SYSTEM.CURRENT_FIELD" is an ambiguous
>
>field name. It didn't find it ambiguous in the 1st situation. Both blocks being used have more than one column and for each I have the cursor positioned
>Oracle no longer finds this ambiguous! Is the problem related to the fact
>that I'm in a form called by another?????
>
>Secondarily, I don't seem to be able to say
>
>#EXEMACRO GOFLD &GLOBAL.curr_atom, although in the calling form
>#EXEMACRO CALL  &GLOBAL.curr_aa; worked no problem.
>
> Is this problem a difference between how Oracle handles block names and
> form names ( and the corresponding GOFLDs and CALLs) or once again
> could it possibly have to do with nesting level?
>
> THanks for all the help so far.

It sounds like you have two fields with the same name on the form. To resolve
the ambiguity do a #copy &SYSTEM.CURRENT_BLOCK || &SYSTEM.CURRENT_FIELD
instead. Hope this helps your problem.

tog
{
Terry O. Greenlaw             Sheathed within the Walkman, 
Staff Engineer                Wear a halo of distortion.
Oracle Corporation            Aural contraceptive,
tgreenla@oracle.oracle.com    Aborting pregnant conversation - Marillion

tgreenla@oracle.uucp (Terry Greenlaw) (09/18/90)

In article <1990Sep17.200151.11764@oracle.com> I wrote
>It sounds like you have two fields with the same name on the form. To resolve
>the ambiguity do a #copy &SYSTEM.CURRENT_BLOCK || &SYSTEM.CURRENT_FIELD
>instead. Hope this helps your problem.
>
>tog

Sorry about the mungled (and obviously incorrect) answer. It should read:

#COPY &SYSTEM.CURRENT_BLOCK || '.' || &SYSTEM.CURRENT_FIELD ....
This will help SQL*Forms resolve which field you are talking about. The reason
your example worked for blocks is because their names are unique inside a form.
Ditto for calling forms. I just forgot to cat a period in there before.

I mentioned before about having a document which allows you to do pop-up
windows and pull-down menus in SQL*Forms ver 2.x. I can't find it in my
archives, so I will have to write it over from scratch. It really isn't hard
to do, but I want to make sure that the instructions I give will actually
work (see mangled message above), so it will have to wait until I get home 
for the weekend to try them out. I will also include a sample .inp file that
uses the technique as a template. Sorry about the delay,

tog
Terry O. Greenlaw             Sheathed within the Walkman, 
Staff Engineer                Wear a halo of distortion.
Oracle Corporation            Aural contraceptive,
tgreenla@oracle.oracle.com    Aborting pregnant conversation - Marillion