We have to copy several "real" tables in temp for processing. Currently we are Navi 5.1 - SQL 2005.
We have several options, but I was looking for the most efficient and fastest method in Navision code.
1.
Table.SETRANGE(Field,Filter);
...
If Table.FINSET(FALSE,FALSE) THEN
REPEAT
TempTable.COPY(Table);
TempTable.INSERT;
UNTIL Table.NEXT=0;
2.
Table.SETRANGE(Field,Filter);
...
If Table.FINSET(FALSE,FALSE) THEN
REPEAT
TempTable.Field1 := Table.Field1;
....
TempTable.INSERT;
UNTIL Table.NEXT=0;
Any ideas would be appreciated. I guess these are the only 2 methods, but with the number of tables moving to temp I wanted to make sure I'm doing this the best method possible within Navision.
Thanks
Steve
0
Comments
that's my thought - not knowing what you are ultimately trying to do.
edit: :oops:
yes yes. not COPY but temprec := rec.
If they are different, but the fields have same IDs, you can use
If they are totally different, you can use your second example. The first one have bigger overhead, because the COPY function copy filters and other things too...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.