/ ReadDB: Data Base read routine for MUL access method. */ /
| 424 | /* ReadDB: Data Base read routine for MUL access method. */ |
| 425 | /***********************************************************************/ |
| 426 | int TDBMUL::ReadDB(PGLOBAL g) |
| 427 | { |
| 428 | int rc; |
| 429 | |
| 430 | if (NumFiles == 0) |
| 431 | return RC_EF; |
| 432 | else if (To_Kindex) { |
| 433 | /*******************************************************************/ |
| 434 | /* Reading is by an index table. */ |
| 435 | /*******************************************************************/ |
| 436 | strcpy(g->Message, MSG(NO_INDEX_READ)); |
| 437 | rc = RC_FX; |
| 438 | } else { |
| 439 | /*******************************************************************/ |
| 440 | /* Now start the reading process. */ |
| 441 | /*******************************************************************/ |
| 442 | retry: |
| 443 | rc = Tdbp->ReadDB(g); |
| 444 | |
| 445 | if (rc == RC_EF) { |
| 446 | if (Tdbp->GetDef()->GetPseudo() & 1) |
| 447 | // Total number of rows met so far |
| 448 | Rows += Tdbp->RowNumber(g) - 1; |
| 449 | |
| 450 | if (++iFile < NumFiles) { |
| 451 | /***************************************************************/ |
| 452 | /* Continue reading from next table file. */ |
| 453 | /***************************************************************/ |
| 454 | Tdbp->CloseDB(g); |
| 455 | Tdbp->SetUse(USE_READY); |
| 456 | Tdbp->SetFile(g, Filenames[iFile]); |
| 457 | Tdbp->ResetSize(); |
| 458 | ResetDB(); |
| 459 | |
| 460 | if (Tdbp->OpenDB(g)) // Re-open with new file name |
| 461 | return RC_FX; |
| 462 | |
| 463 | goto retry; |
| 464 | } // endif iFile |
| 465 | |
| 466 | } else if (rc == RC_FX) |
| 467 | strcat(strcat(strcat(g->Message, " ("), Tdbp->GetFile(g)), ")"); |
| 468 | |
| 469 | } // endif To_Kindex |
| 470 | |
| 471 | return rc; |
| 472 | } // end of ReadDB |
| 473 | |
| 474 | /***********************************************************************/ |
| 475 | /* Data Base write routine for MUL access method. */ |
no test coverage detected