kingsley143
3rd July 2017, 15:21
Moved to correct forum. Tools Development.
If you just want to check if the record exists in the two tables, a better option will be to create two different functions to check if the record exists.
e.g.
function read.main.table()
{
select tisfc001.*
from tisfc001
where tisfc001._index1 inrange {:pdno.f} and {:pdno.t}
and tisfc001.cprj inrange {:cprj.f} and {:cprj.t}
and tisfc001.cldt < :prdt.f
order by tisfc001._index1,tisfc001.mitm asc
selectdo
if record.exists.in.ticst001() then
do this...
endif
....similar function for ticst002...
endselect
}
function domain tcbool record.exists.in.ticst001()
{
select ticst001.*
from ticst001
where ticst001._index1 = :tisfc001.pdno
as set with 1 rows
selectdo
return(true)
endselect
return(false)
}
If you just want to check if the record exists in the two tables, a better option will be to create two different functions to check if the record exists.
e.g.
function read.main.table()
{
select tisfc001.*
from tisfc001
where tisfc001._index1 inrange {:pdno.f} and {:pdno.t}
and tisfc001.cprj inrange {:cprj.f} and {:cprj.t}
and tisfc001.cldt < :prdt.f
order by tisfc001._index1,tisfc001.mitm asc
selectdo
if record.exists.in.ticst001() then
do this...
endif
....similar function for ticst002...
endselect
}
function domain tcbool record.exists.in.ticst001()
{
select ticst001.*
from ticst001
where ticst001._index1 = :tisfc001.pdno
as set with 1 rows
selectdo
return(true)
endselect
return(false)
}