batchmove and indexes: cannot recreate indexes based on original table

Hello,

I want to batchmove tables between Oracle 7.3 (HP unix) and D3c/s local
Paradox, but thought it would be nice to also locally recreate the
indexes that are used in Oracle. I tried for a couple of days all kind
of scenarios but all perish in the BDE somewhere.
Errors range from "Invalid index/tag name" to a criptic "Number not
found", or "Feature not supported".

Basic setup has a datamodule with source on Oracle and destination on
local Paradox plus batchmove object. Three possible ways to do it:

1. Copy table first, then AddIndex:
    try begin

      with dbDest do if (IsSQLBased) then StartTransaction;
      BatchMove1.Execute;
      taSource.IndexDefs.Update;
      dmBatchMove.taDest.IndexDefs.Assign(taSource.IndexDefs);
// identify the Oracle primary key first or Paradox goes bonkers
     for i := 0 to taSource.IndexDefs.count - 1 do
// our primary keys all end with ' _PK'
       if copy(taSource.IndexDefs.Items[i].name,
         length(taSource.IndexDefs.Items[i].name)-2,3)'='_PK' then begin

         pki:=i;
// add ixPrimary to options as D3 does not detect it automatically
         taDest.AddIndex(taSource.IndexDefs.Items[i].name,
 taSource.IndexDefs.Items[i].fields,taSource.IndexDefs.Items[i].options+[ixPrimary]);

       end;
    taDest.IndexDefs.Update;
// add other non-primary keys
    for i := 0 to dmBatchMove.taSource.IndexDefs.count - 1 do
      if  i<>pki then begin
         dmBatchMove.taDest.AddIndex(
           dmBatchMove.taSource.IndexDefs.Items[i].name,
           dmBatchMove.taSource.IndexDefs.Items[i].fields,
          dmBatchMove.taSource.IndexDefs.Items[i].options);
      end;

The primary key is created OK, but has an empty name in the IndexDefs as
do all the Paradox primary keys. The first attempt to create a secondary
key crashes out with 'Invalid index/tag name'

Curiously enough, this also happens when I use the same procedure on two
local paradox tables, so it definitely is not a problem with the Oracle
server.

2. Create table and indexes first, then copy/append data

Following is code segment grabbed straight from the help file and
adapted to my dataset. With the name and fields hardcoded it works fine,
but when I run it using the info from the Oracle table (taSource) the
CreateTable statement aborts with the really helpful error message:
"..raised EDBEngineError with message 'Number is out of range. Table
does not exist' . Substituting with strings temp1 and temp2 to try and
outwit the items[x] does not help either.

....
  TableType := ttParadox;
  TableName := 'CustInfo';

  with FieldDefs do begin
    Clear;
 Add(dmBatchMove.taSource.FieldDefs.Items[0].name,dmBatchMove.taSource.FieldDefs.Items[0].datatype,
dmBatchMove.taSource.FieldDefs.Items[0].size, True);

Add(dmBatchMove.taSource.FieldDefs.Items[1].name,dmBatchMove.taSource.FieldDefs.Items[1].datatype,
dmBatchMove.taSource.FieldDefs.Items[1].size, False);
  end;

  temp1:=srepl(';',',',dmBatchMove.taSource.indexDefs.Items[0].fields);
  temp2:=srepl(';',',',dmBatchMove.taSource.indexDefs.Items[1].fields);
  with dmBatchMove.taDest.IndexDefs do begin
    Clear;
    { The first index has no name because it is a Paradox primary key }
    Add('',temp1 , [ixPrimary, ixUnique]);
    Add('Fld2Indx', temp2, [ixCaseInsensitive]);
  end;

  CreateTable;

And nothing!  Anybody know where this not-found number is lurking?

3. Copy table, then use ALTER TABLE sql statement to add primary keys:

    Error: feature not supported

I've seen quite a few messages dealing with index blues, but this
appears to be new. Anybody have any suggestions? Is my code wrong, or is
there yet another way to do this. Perhaps it IS impossible, and is that
the reason it is not done already inside the batchmove component. But
then again, am I the only one who would want to create more than one
index on the fly at run-time?

Sorry for this somewhat lengthy message. Many thanks for any
comments/suggestions

Lewie Dekker