strange behaviour TMyTable
Posted: Thu 12 Nov 2009 11:58
I notice, IMHO very strange behaviour when posting a record to a table. The situation is as follows.
I have a table with a respectable number of 13 million records. I need to load more records in that table and I'm using a pretty straightforward way of doing that :
TMyTable.Append;
TMyTable.FieldByName('FIELD1').AsString := 'FIELD1';
TMyTable.FieldByName('FIELD2').AsString := 'FIELD2';
TMyTable.FieldByName('FIELD3').AsString := 'FIELD3';
TMyTable.Post;
This code raises an out-of-memory-exception on the post. It seems that when I post a record, the TMyTable is reading all of the records in the table to finally append a new record. Since I have so many records in that table already, I get an out of memory since the memory needed exceeds the Windows XP addressable memory limit. I can see this through the Task Manager.
I am using MyDac version 5.5 on Delphi 2007, MySQL version 5.1.36. I just downloaded the latest version of MyDac, giving me the same results.
I will try using SQL-statements to insert records, but I need to change an application hat currently uses Paradox tables, to use MySQl as the database. And that application is using a lot of FIELDBYNAME-code etc.
How can I solve this problem ?
I have a table with a respectable number of 13 million records. I need to load more records in that table and I'm using a pretty straightforward way of doing that :
TMyTable.Append;
TMyTable.FieldByName('FIELD1').AsString := 'FIELD1';
TMyTable.FieldByName('FIELD2').AsString := 'FIELD2';
TMyTable.FieldByName('FIELD3').AsString := 'FIELD3';
TMyTable.Post;
This code raises an out-of-memory-exception on the post. It seems that when I post a record, the TMyTable is reading all of the records in the table to finally append a new record. Since I have so many records in that table already, I get an out of memory since the memory needed exceeds the Windows XP addressable memory limit. I can see this through the Task Manager.
I am using MyDac version 5.5 on Delphi 2007, MySQL version 5.1.36. I just downloaded the latest version of MyDac, giving me the same results.
I will try using SQL-statements to insert records, but I need to change an application hat currently uses Paradox tables, to use MySQl as the database. And that application is using a lot of FIELDBYNAME-code etc.
How can I solve this problem ?