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

shah_bs
2nd September 2008, 23:52
I my case I would look into log.oracle8 and log.ora.sql to determine possible hints for the error. [There is no documentation that I could find for error 1000].

Behind the scene, BAAN adds two field related to reference counters and you are possibly corrupting these in the new record.

BaanInOhio
3rd September 2008, 00:11
If copying the fields only, you will want to determine where the first field starts and where the last field ends within the buffer, using copy.mem for that range only. Other data is hidden that can corrupt the records when copied: _compnr, reference counters, dlock, and index (hash) fields. Use something like 'rdi.column' (3rd argument) to find the starting positions of fields that you care about.

avpatil
3rd September 2008, 05:35
Hi,
It seems I have changed table defintion (moved field position), and through Baan I was able to add. Once I restart Baan I was able to change it. So error1000 is resolved.

How will I find where the position starts, as when I see my rec.buff in debug I cannot see any value.

Arvind Patil