I am trying to replicate an archiving process that is not working correctly in a third party software. What I am trying to do is to copy all records prior to a given date and transfer them into a clone of the original data file. Then delete them from the original file.
The partially completed statement that I used is:
INSERT into ContHist_Recs401 ("Conthist Fund","Conthist Member","Conthist Eff-Date","Conthist Type","Conthist Acc Type","Conthist Tran Type","Conthist Batch No","Conthist Pad","Conthist Flags","Conthist Coy Code","Conthist Preserved","Conthist Unpreserved","Conthist Pres Units","Conthist Unp Units","Conthist Date Appl","Conthist Ledger Date","Pad","Conthist Due Date","Conthist Def Unit Fl","Conthist Created","Conthist Modified","Conthist Deleted")
SELECT "Conthist Fund","Conthist Member","Conthist Eff-Date","Conthist Type","Conthist Acc Type","Conthist Tran Type","Conthist Batch No","Conthist Pad","Conthist Flags","Conthist Coy Code","Conthist Preserved","Conthist Unpreserved","Conthist Pres Units","Conthist Unp Units","Conthist Date Appl","Conthist Ledger Date","Pad","Conthist Due Date","Conthist Def Unit Fl","Conthist Created","Conthist Modified","Conthist Deleted"
FROM "Mem Cont Hist Recs"
WHERE "Conthist Ledger Date" <= '2002/09/30'
But this produces the following error:-
ODBC Error: SQLSTATE = S1000, Native error code = -4977
The data buffer parameter is too short(Btrieve Error 22)
Even when I export the records out into a text file and import the text into the cloned data file I get the same response.
The software is Windows 2003 with Pervasive 8 and is run through the Remote Desktop.