avpatil
2nd September 2008, 22:40
Hi,
I have a requirement where I need to copy records from one table to another with almost similar table structure. I have added the fields that are different in the end. Here is waht I did
copy.mem(rec.buf, rcd.table1)
then I selected the second table
select table2
from table 2 for update
where table2._index1 = {:key1}
order by table2._index1
selectempty
copy.mem(rcd.table2, rec.buf)
db.record.to.colums(table2)
db.insert(table2, db.retry)
endselect
commit.transaction()
I am able to insert record, but if I try to delete the record, I get error 1000. Any reason. I tried similar threads on forum, but didn't find.
Thanks
Arvind Patil
I have a requirement where I need to copy records from one table to another with almost similar table structure. I have added the fields that are different in the end. Here is waht I did
copy.mem(rec.buf, rcd.table1)
then I selected the second table
select table2
from table 2 for update
where table2._index1 = {:key1}
order by table2._index1
selectempty
copy.mem(rcd.table2, rec.buf)
db.record.to.colums(table2)
db.insert(table2, db.retry)
endselect
commit.transaction()
I am able to insert record, but if I try to delete the record, I get error 1000. Any reason. I tried similar threads on forum, but didn't find.
Thanks
Arvind Patil