ramanasree.v
25th October 2016, 14:12
Hi,
Hi,
I am getting below fatal error in db_first.

Fatal error: Error 2000 (bdb_errno 2000) on tdilc900404 in db_first
Fatal error: Can not continue in tdslso950m000 (<26>)[db.first]

Corresponding code is:

function open.archive.ilc900()
{
long row_length
string buffer based

lfn.sls.orig=db.bind("ttdilc900")
db.row.length(ttdilc401,row_length)
alloc.mem(buffer,row_length)
db.columns.to.record(ttdilc900)
buffer = rcd.ttdilc900
lfn.sls.arch = db.bind ("ttdilc900",rcd.ttdilc900,arch.comp)

if db.first (lfn.sls.arch) = enotable then
commit.transaction()
if db.create.table (lfn.sls.arch) then
mess("tcmcss0346",1,"ttdilc900")
exit()
endif
endif
rcd.ttdilc900 = buffer
db.record.to.columns(ttdilc900)
}

Any idea how to avoid this fatal error? I searched on net but didnt get any relevant information.

bhushanchanda
25th October 2016, 14:33
You may try unbinding the first db.bind() if the companies are same.

Also, I see you are directly passing table codes to db.columns.to.record() and db.row.length() instead of the id obtained by db.bind(). Try modifying these parts and I guess it should not be an issue anymore.

ramanasree.v
1st December 2016, 11:39
db.unbind is not used since both are different companies. I tried passing the return variable from db.bind to the functions you mentioned. But it didn't work. It gave the same fatal error.