Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!munnari.oz.au!samsung!zaphod.mps.ohio-state.edu!swrinde!mips!decwrl!fernwood!oracle!news From: kbittner@oracle.uucp (Kurt Bittner) Newsgroups: comp.databases Subject: Re: Can one reference global vars in SQL stmts in ORACLE SQL*Forms? Message-ID: <1990Sep11.143705.10758@oracle.com> Date: 11 Sep 90 14:37:05 GMT References: <11212@spool.cs.wisc.edu> Reply-To: kbittner@oracle.UUCP (Kurt Bittner) Organization: Oracle Corporation, Belmont, CA Lines: 32 In article <11212@spool.cs.wisc.edu> beverly@ai.cs.wisc.edu (Beverly Seavey (-Kung)) writes: > > In one of my triggers I have an SQL statement that refers to a > global var: > > > SELECT atom_numb, atom_name > INTO poss_atoms.atom_numb, poss_atoms.atom_name > FROM atom_lookup > WHERE atom_lookup.nucleus = global.curr_nucleus; > > ****** > > > > When the trigger gets triggered I get an error msg saying that > curr_nucleus is an invalid column name. Changeing the column name > doesn't help. THe value of global.curr_nucleus was set up by > a form that called this one. In the SQL*Forms manuals there are > no examples of use of global vars in SQL. Is it allowed? You cannot reference global variables in a SQL statement in Forms 2.3; you will have to #COPY the value in the global variable to a hidden field (on Page 0), then reference that field. SQL*Forms 3.0 DOES allow global fields to be referenced in a SQL statement, so for that reason (and many others) you will want to upgrade as soon as Forms 3.0 is available on your machine. Kurt Bittner kbittner@oracle.com Field Technical Rep "My opinions are purely my own and in no way Oracle Corporation represent the official views of my employer."