Conversion of data & associated logic from ISAM to RDB



We are using Micro Focus Net Express 4.0 and Microsoft SQL Server
2000. The concepts/examples we are seeking however can be more
generic, i.e., not necessarily shown within COBOL source code per se.

Right now we have two realized problems, both of which appear to stem
from our mutual and still-thriving ignorance......

The first problem is as follows: We are having surprising difficulty
in our attempts to find working examples of SQL-related code sequences
for handling low-volume user-entered updates vs large-volume batch
updates. The working examples we need can be represented as pseudo-
code and/or actual code - we don't really care which - we just need
something representative to work from. (See fictitious example
enclosed)

The second problem involves how to handle record locking issues among
multiple users. The lead analyst wants us to code logic that requires
maintenance of a date-time field in every record - this date-time
stamp would then be used for determining the availability of a given
record such that unilaterally-applied changes are not given an
opportunity to sneak in while another user has said record in a state
of flux. I'll spare you the further gory details of this terrifying
scheme for now, but suffice it to say we do not like it because it
seems that we would end up re-inventing the wheel, given that the rdb
is supposed to have various locking detection/tools already built into
it.

Here is a simple/fictitious representation of the type of code
sequence samples that we are looking for...

Typical LOW-VOLUME USER UPDATE module:
1. Open rdb
2. EXEC SQL WHENEVER SQLERROR DO sql_error;
3. Accept record key from user
4. Read matching record w/ shared lock (presume REC-FOUND for this
example)
5. Display fields on screen
6. Accept field updates from user
7. Edit field updates (presume EDIT-PASSED for this example)
8. BEGIN TRANSACTION
9. Read record from table with exclusive lock
10. Move new field values to table
11. Rewrite table record
12. COMMIT
13. END TRANSACTION
14. Close rdb


Typical HIGH-VOLUME BATCH UPDATE module:
1. Open rdb
2. ~?~?~
3. ~?~?~
4. ~?~?~


Perhaps there is a site somewhere that includes sql-related coding
examples? I appreciate in advance any input that anyone may have
about how we should be approaching this data conversion effort.

Sincerely,
Dave Miner

.