jcook331
16th May 2007, 21:58
I have two tables with one being an exact copy of the other. When a certain field is entered on one table I need that entire record inserted on the other table. There are quite a few records on the table and I was wondering if there was a way to insert a record to the duplicate table without listing out each field and setting it equal to the other field. I was thinking there was, but I might be wrong. Thanks

mark_h
16th May 2007, 22:32
Like this:

db.set.to.default(ttpppc981)
rcd.ttpppc981 = rcd.ttpbcr601
db.insert(ttpppc981)

Beware that there are some other fields like _compnr that you might need to set. One has to do with locking and you could end up with an error. This is one method I use to copy complete records.