Subject RE: [IBO] Using DataPump
Author Helen Borrie
At 05:03 PM 3/06/2003 +0300, you wrote:
>Spoke too soon :)
>Pump works OK when source and destination tables have identical names (at
>least it seems this way)
>When I have
> "select * from DOM_PAY" as source cursor
> "select * from DOM_PAY_LV" as destination cursor
>I get error "ID is required field"

Why are you using a SELECT statement for the destination? Use a
parameterised INSERT statement in a TIB_Cursor. If you want to generate
new IDs for the pumped rows, omit the ID field from the INSERT
statement. If you want to copy the ID from the source record, include it,
and map it to the relevant input parameter of the dest statement.

Use an explicit column list in the source statement, not select *.

>If I set the value in AfterFetchRow event
> dest->ByName("ID"->AsInteger= ARow->ByName("ID")->AsInteger;
>then it finds next missing field.
>Looks like Pump cannot match the source and destination datasets.

>If I open the Pump Editor and press ItemActions->Prepare, then Pump shows
>correct pairs in DstLinks, so it understands how to match them.

If you need to take control of this yourself, you can set your own DstLinks
at design-time. TIB_stringlist entries of the form

>All hints are welcome.

The main thing is to replace that SELECT statement in the destination