Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!unisoft!fai!sequent!lugnut From: lugnut@sequent.UUCP (Don Bolton) Newsgroups: comp.databases Subject: Re: Can one reference global vars in SQL stmts in ORACLE SQL*Forms? Message-ID: <42157@sequent.UUCP> Date: 11 Sep 90 01:34:18 GMT References: <11212@spool.cs.wisc.edu> Reply-To: lugnut@sequent.UUCP (Don Bolton) Organization: Sequent Computer Systems, Inc Lines: 45 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? Been awhile since I've mucked with "O" forms but I used to do similar things quite frequently.. You must do a #COPY on your global.var into a field and then compare *that* field to your data field. I assume you have an event trigger that calls the form that sets your value. add the step to do the #COPY to it. Ie: last step...#COPY global.var :poss_atoms.nondatabasefield (I would use a non database field hidden on page 0) then do your compare to the non database field.. select atom_numb, atom_name into poss_atoms.atom_num, poss_atoms.atom_name from atom_lookup.nucleus where atom_lookup.nucleus = poss_atoms.nondatabasefield As I said it been awhile, used to do TONS of this. I can supply some examples if you get stuck. (Provided I can find them old .inp files :-)) I've been Informixed up of late :-) ********************************************************************* The monitor shows a system floating down a river on a lazy afternoon, My terminal is a picture of a command long forgotten, A sensation of suspense fills the air, Did I forget the command "oracle start your engine"?