I want to insert data into a table from two other tables. But after having inserted the first set of data I only want to add data from the second table if one of the field does not already have that value. i.e. I want to keep that field unique. I have managed to do this using while select, but since the tables are big this takes quite some time. Is there a way to do this using insert_recordset isntead? Or another way to speed it up?
while select * from tableB { select * from rTable where rTable.Voucher == tableB.Voucher; if(rTable.Voucher == ""){ rTable.VendAccount = tableB.DisplayValue; rTable.Voucher = tableB.Voucher; rTable.Date = tableB.Due; rTable.Credit = tableB.AmountCurCredit; rTable.InvoiceId = tableB.Invoice; rTable.insert(); } }