mbdave
12th January 2007, 07:53
Hi

we had use comparison in baan 5 in select query but in LN its giving compilation error please provid any solution i even tried to use variable but still its giivng error

e.g. for clarification

tdsls400.aaaa say is a table field of tdsls400.
i have this to field values both of same domain
now i am using it as

select tdsls401.*
from tdsls401
where tdsls401._index1 = {:tdsls400.orno}
and (tdsls401.xxxx <> :tdsls400.aaaa)
selectdo
endselect


this is giving error even talking tdsls400.aaaa's value in a variable is giving error incompatibl data type please give me a soltuion.
__________________
Thanks and Regards
Mahesh B D
Baan Professional

bigjack
12th January 2007, 09:11
Can you let us know the exact fields from tdsls400 & tdsls401 table which you are comparing ?

mbdave
12th January 2007, 09:35
fine take the original code
it compiles fine in Baan5 and gives err in LN

select whwmd300.ball, whwmd300.bout,
whwmd300.btri, whwmd300.btrr
from whwmd300
where whwmd300._index1 = {:whinh225.cwar,
:whinh225.loca}
and whwmd300.ball = tcyesno.no
and ((whwmd300.bout = tcyesno.no and :whinh200.ittp = whinh.ittp.issue)
or (whwmd300.btri = tcyesno.no and
(:whinh200.ittp = whinh.ittp.transfer or :whinh200.ittp = whinh.ittp.item.transfer))
and (:whinh200.sfco <> :whinh200.stco or (:whinh200.sfco = :whinh200.stco and whwmd300.btrr = tcyesno.no)))
as set with 1 rows
selectdo
selectempty
dal.set.error.message("whwmds0148",
|* Location %s is blocked
whinh225.loca)
return(DALHOOKERROR)
endselect

wiggum
12th January 2007, 11:25
If this is the original code than i think you get the error field whinh225.loca. In our installation of ERP LN i can't find field loca in table whinh225. I think there was a rename of the field from loca (i found it in BaanERP) to locf (found in ERP LN).

bigjack
12th January 2007, 11:47
I tried this code in my setup and got a compile error in the line,
:whinh200.sfco <> :whinh200.stco

Most probably LN doesnt support comparison of two "binded" variables(variables with a colon as prefix). Either join the two tables i.e. whwmd300 & whinh200 or You will have to check the required condition before entering the select statement for table whwmd300. Something as given below



long equal

if whinh200.sfco <> whinh200.stco then
equal = 0
else
equal = 1
endif
select whwmd300.ball, whwmd300.bout,whwmd300.btri, whwmd300.btrr
from whwmd300
where whwmd300._index1 = {:whinh225.cwar,:whinh225.locf}
and whwmd300.ball = tcyesno.no
and ((whwmd300.bout = tcyesno.no and :whinh200.ittp = whinh.ittp.issue)
or (whwmd300.btri = tcyesno.no and
(:whinh200.ittp = whinh.ittp.transfer or :whinh200.ittp = whinh.ittp.transfer))
and (:equal = 0 or (:equal =1 and whwmd300.btrr = tcyesno.no)))
as set with 1 rows
selectdo
endselect



Two more observations, as pointed out earlier whinh225 table doesnt have loca field. Its probably changed to locf. The enum domain whinh.ittp doesnt have value item.transfer. So kindly check these two issues.