 
    
    
         
 Next:  System configuration
Up:  Programing example:a personel 
 Previous:  Manipulations of database
 
 
There are following three tables in irpr system.
- meibo
-  keeps the newest data of the membership list.
 
- meibo_history
-  keeps updated records of the membership list.
 
- meibo_id
-  keeps the maximum id given to the latest member.
  
The procedures related to each command parameter "Mode" are described .
- anm
-  add_new_member
  -  begins a job.
   
-  locks the three tables in exclusive mode and begins a
	transaction.
   
-  gets the newest id from meibo_id table.
    -  reads the record.
     
-  If the record exists, the newest id(NewId) is the maximum
	id plus 1. If not, "NewId" is 1.
     
-  writes back "NewId" as the new maximum id to meibo_id table.
    
 
-  adds a member to meibo table.
    -  adds "NewId" and 1 as the version to the member information.
     
-  makes a record from the member information.
     
-  appends the record to meibo table.
    
 
-  ends the transaction.
   
-  ends the job.
  
 
  
- mm
-  modify_member
  -  begins a job.
   
-  locks the three tables in exclusive mode and begins a
	transaction.
   
-  gets the id(ID) and the version(Version) from the member 
	information.
   
-  gets the set(Set) as a result of index searching with a 
	search condition(id=ID).
   
-  increments "Version" by 1 and updates the version of the
	member information.
   
-  makes a record(NewRec) from the member information.
   
-  reads the record(Rec) specified by "Set" from meibo table.
   
-  modifies the record.
    -  checks if the version of "Rec" and "Version" in the member 
	information matches.
     
-  writes "NewRec" on the position of "Rec" in meibo table.
    
 
-  leaves a record in meibo_history table.
    -  appends "Rec" to meibo_history table.
    
 
-  ends the transaction.
   
-  ends the job.
  
 
  
- dm
-  delete_member
  -  begins a job.
   
-  locks the three tables in exclusive mode and begins a
	transaction.
   
-  gets the id(ID) and the version(Version) from the member 
	information.
   
-  gets the set(Set) as a result of index searching with a 
	search condition(id=ID).
   
-  increments "Version" by 1 and updates the version of the
	member information.
   
-  makes a record(NewRec) from the member information.
   
-  reads the record(Rec) specified by "Set" from meibo table.
   
-  deletes the record.
    -  checks if the version of "Rec" and "Version" in the member 
	information matches.
     
-  delete a record at the position of "Rec" in meibo table.
    
 
-  leaves a record in meibo_history table.
    -  appends "Rec" to meibo_history table.
    
 
-  ends the transaction.
   
-  ends the job.
  
 
  
- scd
-  search_current_data
  -  begins a job.
   
-  read-locks meibo and meibo_history tables and begins a
	transaction.
   
-  searches meibo table.
    -  selects a set which matches the search condition.
     
-  reads the records specified by the set on demand of output.
    
 
-  ends the transaction.
   
-  ends the job.
  
 
  
- shd
-  search_history_data
  -  begins a job.
   
-  read-locks meibo and meibo_history tables and begins a
	transaction.
   
-  searches meibo_history table.
    -  The procedures of searching is the same as scd.
    
 
-  ends the transaction.
   
-  ends the job.
  
 
  
- sad
-  search_all_data
  -  begins a job.
   
-  read-locks meibo and meibo_history tables and begins a
	transaction.
   
-  searches both meibo and meibo_history tables.
    -  The procedures of searching is the same as scd.
    
 
-  ends the transaction.
   
-  ends the job.