>SELECT Table1 >nRec = RECNO() > >SELECT *, DATETIME() AS Field1, SPACE(11) AS Field1,; > SPACE(1) AS Field3, SPACE(2) AS Field4; > FROM Table1; > WHERE RECNO() = nRec; > INTO CURSOR Temp1 > >SCATTER NAME oRecord MEMO > >oRecord.Field1 = DATETIME() >oRecord.Field2 = "Some Value" >oRecord.Field3 = "A" >oRecord.Field4 = "01" > >SELECT Table2 APPEND BLANK >GATHER NAME oRecord MEMO >Kevin,
local oRecord select table2 append from table1 for f1 = table1.f1 and f3=table1.f3 and f4=table1.f4 scatter name oRecord memo oRecord.Field1 = DATETIME() oRecord.Field2 = "Some Value" oRecord.Field3 = "A" oRecord.Field4 = "01" gather name oRecord memo fields Field1,Field2,Field3,Field4Or with structures matching as you said except 4 on the 'right' (assuming tables have no general fields and last for fields are in that order) :
LOCAL ARRAY arrRecord[1,FCOUNT('table2')] local lnOffset lnOffset = fcount('table1') SELECT table1 SCATTER TO arrRecord MEMO arrRecord[1,lnOffset+1] = datetime() arrRecord[1,lnOffset+2] = "Some Value" arrRecord[1,lnOffset+3] = "A" arrRecord[1,lnOffset+4] = "01" INSERT INTO table2 FROM ARRAY arrRecordMaking the array 2 dimensional is not mandatory in this particular case but it more resembles multirow table structure (I sometimes use this to transfer multiple records at once).