Hi, all

I am maintaining a software based on ASA6.03. In the program, it extract data to flat files from consolidate database by using dbxrtact, then use dbisql to run the reload.sql to load the data to a remote database. But sometimes the dbisql get a commication error when it execte the statement in reload.sql.

ALTER TABLE "rio"."InvoiceHeader"
ADD FOREIGN KEY "PaymentTerms" ("PaymentTerms")
REFERENCES "rio"."PaymentTerms" ("PaymentTerms")
go


it didn't happen everytime, sometimes it get the error, then I run the same process again, then it works. for the invoiceheader table, it also have another foreign key, but it never have any problem.

ALTER TABLE "rio"."InvoiceHeader"
ADD FOREIGN KEY "ShipVia" ("ShipVia")
REFERENCES "rio"."ShipVia" ("ShipVia")
go


I don't understand why it is like this, Does someone know why this happens?

Thanks in advance!