Mike Yearwood
Toronto, Ontario, Canada
>I have a routine that copies records from one table to another. Sounds simple, but when APPEND is used, the size of the tables exceeds the available memory and cause a Stack Fault.
>
>I rewrote it so that the records write over existing records (based on matching criteria) using SCATTER MEMVAR and GATHER MEMVAR and use a INSERT - SQL if more records are needed. The problem is that this takes a long time. I can watch the records being written over. The matching criteria is by State and if I have a lot of states to copy, it is painful. (Even one state is painful.)
>
>Anyone have any better ideas?
>
>Sarah
Your message seems to indicate that you have to update existing records in one table with corresponding records in the other table. Do you also add new records to the existing table from the other table?. I'm not sure what you mean by the size of the table causing a stack fault. I've built a nice piece of code to compare the "other" table to the existing table. Its done with 2 SQLs. The first SQL looks for existing records that have some difference. The second SQL looks for new records. The source table is 90,000 records and the existing (target) table is over 1 Million.
The entire process is very very fast. If this sounds like what you need send me an email and I'll post a sample.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only