Hi Gurus

I need some big time assistance this time.

I have a situation where many similar applications that are running on client
machines need to access a database count field in which these applications
will read the count value of the database, increment it and later update
it back into the database.

By doing this, I hope to achieve the goal where each application would then
only have a single different count value everytime they access the database.
No two or more applications would be able to have an identical count value
at any time. Sadly, this does not happen.

For example, two applications accessing the same database table at almost
the same time with the Select statement, both applications will read the
same value of the count. And therefore both application will have the same
count value. Now this is wrong. Is there a way that I could do such that
both application does not retrieve the same count value.

Locking the database is only when you insert, delete or update the database.
Using select statement does not lock anything as no editing was being done.
For my application, I select the record first, increment it and then update
later. Is there a way where all this can be done within a single operation
and the database can lock it such that other applications cannot read the
value while this application is still accessing the database count field.



rgds,
Saiful