Table of Content
HAL Forum
function boolean ClearRDBData (
string RegisterName)
Description:
Deletes all the data of a specified register in the relational database (if it has been set up correctly). Returns false if an error occurs.
Parameters:
RegisterName The name of the register identificator that is being cleared in the RDB.
global
updating procedure RDBDoClearData(LongInt rwn)
begin
  Integer wn,i,rwcnt;
  record RDBRegsBlock RDBr;
  row RDBRegsBlock RDBrw;
  row RDBRegsBlock RDBrw2;
  
  BlockLoad(RDBr);
  
  MatRowGet(RDBr,rwn,RDBrw);
  
  if (ClearRDBData(RDBrw.RegCode)==false) then begin
    StopAlert("Error clearing RDB Data");
    goto out;
  end;
  
  BlockLoad(RDBr);
  rwcnt = MatRowCnt(RDBr);
  for (i = 0; i<rwcnt; i = i + 1) begin
    MatRowGet(RDBr,i,RDBrw2);
    if (RDBrw.RegCode==RDBrw2.RegCode) then begin
      goto updrow;
    end;
  end;
  
  goto out;
  
updrow:;
  RDBrw2.Valid = 0;
  MatRowPut(RDBr,i,RDBrw2);
  BlockStore(RDBr);
  
out:;
  return;
end;
Related topics:
««