USE MyVfpTable IN 0 SELECT MyVfpTable lnKount = afields(laFields) lcInsert = [INSERT INTO MyOracleTable (PKFieldName, Field2Name, ..., FieldXName) VALUES (?lnNewID,] for lnI = 1 to lnKount if laFields[lnI, 1] == [PKFIELDNAME] loop endif if inlist(laFields[lnI, 2), [C], [V], [M]) && trim any character type data (V is varchar in VFP9) lcInsert = lcInsert + [?RTRIM(MyVfpTable.] + laFields[lnI, 1] + [)] else lcInsert = lcInsert + [?MyVfpTable.] + laFields[lnI, 1] endif if lnI < lnKount lnInsert = lcInsert + [,] endif endfor SCAN SQLEXEC(lnHandle, [get sequencename.nextval as newid from dual], [crsNewID]) lnNewID = crsNewID.NewID lnSuccess = SQLEXEC(lnHandle, lcInsert) if lnSuccess < 0 *** handle error here endif ENDSCANIf you do not care about what the NewID is for child table records, then take it out of the lcInsert above and out of the SCAN loop.