Subject TIB_Datapump loading 0s and duplicates
Author hcarvajalsy
Hello,
I am trying to use TIB_Datapump to load data from one database into
another. In my target database I seem to be getting 0's and it is
also loading 2 records for each record found in the source. The
Yield and CloneCursor properties are set to true. The code being
used is the following:
MySQLDB.SourceDS.UnPrepare;
MySQLDB.TargetDS.UnPrepare;
MySQLDB.SourceDS.SQL.Clear;
MySQLDB.TargetDS.SQL.Clear;
MySQLDB.SourceDS.SQL.Add('SELECT DISTNO,SCHOOL FROM
PATRONMOVS ');
MySQLDB.TargetDS.SQL.Add('INSERT INTO PATRONMOVS
(DISTNO,SCHOOL) ');
MySQLDB.TargetDS.SQL.Add('VALUES(:DISTNO,:SCHOOL) ');
MySQLDB.SourceDS.Prepare;
MySQLDB.TargetDS.Prepare;
MySQLDB.DataPump.SrcDataset := MySQLDB.SourceDS;
MySQLDB.DataPump.Dataset := MySQLDB.TargetDS;
if not MySQLDB.TargetDS.IB_Transaction.InTransaction then
MySQLDB.TargetDS.IB_Transaction.StartTransaction;
MySQLDB.DataPump.Execute;
if MySQLDB.TargetDS.IB_Transaction.InTransaction then
MySQLDB.TargetDS.IB_Transaction.Commit;

Do you have any suggestions on what might be incorrect?
thank you.