Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!oracle!news From: tgreenla@oracle.uucp (Terry Greenlaw) Newsgroups: comp.databases Subject: Re: Oracle Forms question Message-ID: <1990Feb9.202005.2307@oracle.com> Date: 9 Feb 90 20:20:05 GMT References: <8921@portia.Stanford.EDU> Reply-To: tgreenla@oracle.UUCP (Terry Greenlaw) Organization: Oracle Corporation, Belmont, CA Lines: 34 In article <8921@portia.Stanford.EDU> mouser@portia.Stanford.EDU (Michael Wang) writes: >In article <326@sfc.Wichita.NCR.COM> >chas@sfc.Wichita.NCR.COM (Charles Binford) writes: > >> I have a key-nxtfld trigger on a field that sometimes updates another >> display-only field. The field update should *never* happen when the >> record has been queried-up (?) and is being changed (UPDATED). >> If this is a new record (INSERT), then based on other criteria, >> I want to modify the display-only field. >> ... >> My ideal solution would be to access a 'system.mode' variable that >> told me if the current record was either an update or an insert. I >> do not know of any such variable, however :-(. > > >Probably the easiest way to do this is to check the rowid of the row >that you are in. If the rowid is NULL, then you know that the row is >being inserted, otherwise you know the row is being updated. > ...trigger example deleted for brevity... >-Michael Wang > The rowid check is the best way I know of in SQL*Forms versions before 3.0. If you have version 3.0 of SQL*Forms, there is a system variable called SYSTEM.RECORD_STATUS that contains the record status (New, Queried, Changed,etc.) of the record the cursor is currently in. However, the rowid test will still also work with version 3.0. Good Luck, 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