Re: Incrementing sequence number
Posted in 2000
Topics: General Discussion
From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de> > >Paul Watson wrote: > > > A lock on the row perhaps? > >Obnoxio wrote: > > > Lock the "max" record? > >Could the two of you maybe elaborate a little on how to put a lock >on a specific row? With a FOR UPDATE cursor. :0) ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
Obnoxio The Clown wrote: > > From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de> > >Could the two of you maybe elaborate a little on how to put a lock > >on a specific row? > > With a FOR UPDATE cursor. :0) That's what I thought. So it's only possible to do this in a program, not in pure SQL, like in DBACCESS. Thanks for clarifying, Richard -- +--------------------------+------------------------------------------+ | Dr. med Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-6110 | | Klinikum Grosshadern | FAX : +49-89-7095-6420 | | 81366 Munich, Germany | GSM : +49-172-8933578 | +--------------------------+------------------------------------------+
I've gotten the syntax "select ... for update" to work (ie, lock the row)
within a transaction in dbaccess -- with a logging database, of course.
You might want to try this dynamically in a stored procedure.
Richard Spitz wrote:
> Obnoxio The Clown wrote:
> >
> > From: Richard Spitz <Richard.Spitz@ana.med.uni-muenchen.de>
>
> > >Could the two of you maybe elaborate a little on how to put a lock
> > >on a specific row?
> >
> > With a FOR UPDATE cursor. :0)
>
> That's what I thought. So it's only possible to do this in a
> program, not in pure SQL, like in DBACCESS.
>
> Thanks for clarifying,
> Richard
> --
> +--------------------------+------------------------------------------+
> | Dr. med Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de |
> | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-6110 |
> | Klinikum Grosshadern | FAX : +49-89-7095-6420 |
> | 81366 Munich, Germany | GSM : +49-172-8933578 |
> +--------------------------+------------------------------------------+