jholdrid
10th April 2002, 01:07
I have developed a custom session using Baan script. It reads through several line items and deletes them, then deletes the header record associated with them.

When I do a Commit.transaction() to actually delete the records or eleimate the Commit and just read the next header record, I receive the 605 error. I do not have any out standing references assoicated with this table.

What doe the 605 error mean ?

Here is my code:


select tdpck001.*
from tdpck001 for update
where tdpck001._index3 = {:tdpck008.shno}
selectdo
|Read Through package Lines and delete
select tdpck002.*
from tdpck002
where tdpck002._index1 = {:tdpck001.pano}
selectdo
db.delete(ttdpck002, db.retry)
endselect
| Delete Package Heading
db.delete(ttdpck001,db.retry)
| Error 605 occurs here or if I remove Commit, error occurs at next select
-> Commit.transaction
endselect


Thanks for your help

:confused:

srinivas
10th April 2002, 08:46
Add "for update" here

select tdpck002.*
from tdpck002 for update
where tdpck002._index1 = {:tdpck001.pano}


The problem will be solved.

Caner.B
10th April 2002, 09:10
And where is the

db.retry.point()

jholdrid
10th April 2002, 19:31
Thank you srinivas:

I did have a "For Update" for table tdpck002.
I must have skipped it when I re-typed at Baanboard as I was having problems entering and needed to edit my question.

Caner.B

I am always confused as to where to place the db.retry.point()

In this case it is before the first select.

Would that be correct ? Should there be one for each select statement or does the single db.retry.point() function cover all select statements ?

Thanks

evesely
10th April 2002, 21:20
On db.retry.point() before your very first select statement is sufficient.

Have you checked your log files to see if they shed any more light on the reference problem?

jholdrid
18th April 2002, 16:39
Thanks you for your help.

It appears that my error was caused by a problem in our test database.

I ran "Reorganize tables" tdaad4225m00 for the entire module with "Reference Integrity" and "Repair Reference Counter" Checked and my error message has disappeared. :D

gous99
19th April 2002, 18:20
Error 605 is "Reference exists, cannot delete". It has nothing to do with the way you programmed it. Check out your data. There must be an existing relation between the record you are trying to delete and some other field in one (or more) other tables.

If there is (and it should), you need to delete the other record, and then come back to this record and delete it.