eric.dizon
4th September 2014, 23:45
I am getting error 1308 error 308 when I try to use a select statement on the DAL main table I was working with.

The DAL script I have is for table cxcsb010, any other table I can query and update. But for cxcsb010 under the field validation function, it throws out the error below and my select statement is below: Anybody knows how can I execute a select statement to count the records of my main table inside a DAL field.check() function?


Log Name: Application
Source: Infor ES
Date: 9/5/2014 3:44:42 AM
Event ID: 1000
Task Category: bshell
Level: Error
Keywords: Classic
User: EHC\ericd
Computer: ERP2APP.sha.ehc-global.com
Description:
Env : infor_erpln_shanghai (e:\erpln\bse)
Program : bshell file \logic\mir\mir\mul_fun.c # 477
Keyword : Process state:
User : ericd type:S language:2
Process : 3420
Proc.Set : ericd@OSH-DEL-DESK-38.osh.ehc-global.com:12880
Lasterror : 0
Errno : 0
BdbErrno : 1308 (database error 308)
ExtraInfo : session: "cxcsb0010m100";object: "cxcsb0010m100"; function: "cxcsb010.enmk.check" sql.exec; company number: 800
query: "select cxcsb010.*
from cxcsb010
where cxcsb010.mser = {:l.clot}


"
Message : FATAL ERROR: Error 1308 (database error 308) on select
Can not continue in cxcsb0010m100 in DLL: ocxcsb010 (cxcsb010.enmk.check)[sql.exec]

function extern long cxcsb010.enmk.check(long has_changed)
{
long l.ctr

l.clot = cxcsb010.mser
db.set.to.default(tcxcsb010)

select count(cxcsb010.ctid):l.ctr
from cxcsb010
where cxcsb010.mser = :l.clot
selectdo
endselect


}

BaanInOhio
5th September 2014, 01:17
Wouldn't the db.set.to.default(tcxcsb010) used within the DAL for cxcsb010 clear all fields? Seems unnecessary. I have done a select on the same table as the DAL when using an alias buffer, even when just doing a count. As a last resort, could create a DLL function that counts the records and simply call the DLL from the DAL field hook.

bhushanchanda
5th September 2014, 11:25
Hi,

You can follow what Dave said. But just before that try to run the same select loop in a 3GL program independently to check that the table is not having any other problems like bad reconfig etc. If you still face the same error, you need to run a re-organize.

If it works without any problems, you can then try using alias or use a DLL as he said.

eric.dizon
5th September 2014, 16:17
Even with me reorganizing the table using Convert to Runtime Data dictionary or Create Runtime Data still I have the same error. I tried also using an alias to query table same thing. Would calling it into a function makes a difference?

bhushanchanda
5th September 2014, 16:26
Hi,

By reorganize I meant using session Reorganize Tables(ttaad4225m000).

No need to tick Data & Indices, just try running it with tick on Check Validity Reference and Repair Reference Counter.

But first try using DLL as well.

eric.dizon
2nd October 2014, 20:52
Thanks that fixed my issue Bhushanchanda.