rabbeneg
30th December 2002, 17:44
I have create one table (tfcit202) for temporary using report session.

When i press then button continue in session, first I delete the table:

table.id = db.bind("ttfcit202","",xcomp)
commit.transaction()
ret = db.drop.table(table.id,DB.IGNORE.ALL.REFS,xcomp
if ret <> 0 then
ret = db.clear.table(table.id,NO.ROLLBACK,xcomp)
commit.transaction()
if ret <> 0 then
db.retry.point()
select tfcit202.*
from tfcit202 for update
selectdo
db.delete(ttfcit202, db.retry)
commit.transaction()
endselect
commit.transaction()
endif
else
db.create.table(table.id,xcomp)
endif

and after i fill the table:

db.retry.point()
select tfgld202.*
from tfgld202
selectdo
tfcit202.cono = tfgld202.cono
|...
db.insert(....)
endselect

But during this process i receive (in bw message) the following error:
Error 100 (Duplicate value) on tfcit202730 (max retries (10) exceeded.)
This error i impossible because the table is empty.

Best regards

NPRao
30th December 2002, 20:13
Rabbeneg,

It seems a wierd code anyways, try to modify the statement -

db.insert(t<table-name>, db.retry, db.skip.dupl)

I hope this should fix the problem.

OmeLuuk
31st December 2002, 09:29
|rabbeneg:
ret = db.drop.table(table.id,DB.IGNORE.ALL.REFS,xcomp)You may also experience a reference problem: if you do an insert on this table it may also cause an insert on a referenced table. In that case you will get the error 100 on this table where the reference found is in the other table.

Try to run a logging (DBSLOG=010) and see where the error happens.

rabbeneg
31st December 2002, 09:51
Hi, NPRao.

I have try your solution and it's fine.


Thanks....


GR

:)

NPRao
31st December 2002, 20:54
rabbeneg,

I am glad it worked out for you BUT -

From the help manual -

ignore_refs
If you set this optional argument to DB.IGNORE.ALL.REFS, the data is deleted regardless of whether it is referenced by other tables.


I think your program is still wierd to me and I agree with OmeLuuk wrt to the Data Integrity and References.