Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!aramis.rutgers.edu!paul.rutgers.edu!yes.rutgers.edu!emuleomo From: emuleomo@yes.rutgers.edu (Emuleomo) Newsgroups: comp.databases Subject: Re: How do you... Message-ID: Date: 29 Mar 89 16:23:22 GMT References: <1707@anasaz.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 25 It seems that the answer to your problem will be to 1) create an index on the last names 2) Make sure you have a serial fld in your table 3) write the following queries declare cusrs1 cursor for select * from tab1 where last_name >= :last_name for update; /* 'for update' gaurantees row-level locking!! */ open curs1; repeat fetch next curs1 into :serial_fld :last_name_fld etc... ; until(enough_records_fetched || SQLNOTFOUND); Now, to find out if any particular record still exists, all you need to do is access it via its serial fld. -- Emuleomo O.O. Systems Automation. Now to find out