NM_BAAN
14th March 2002, 13:16
In the select Statment want to compare orno and cprj fields.

Example.
select tdsls041.*
from tdsls041
where tdsls041.orno = lval(tdsls041.cprj)
selectdo
......
endselect
But the above is not working... Giving compliation error.

Any clue how to go about it... Could do the same by doing select twice but that takes too long..

Hope to get some help.

Thanks,
NM

Warans
14th March 2002, 14:12
Try this :

Might look odd..but still solves ur problem...

example..
domain tcorno var_cprj

var_cprj = 0

select tdsls041.*
from tdsls041
[where clause if u have anything goes here...]
selectdo
var_cprj = lval(tdsls041.cprj)

if tdsls041.orno = var_cprj then
....
....
[ all these...will be executed only when values of orno and cprj are same ]
endif
endselect
If anybody else know better than this...please post it.

NM_BAAN
14th March 2002, 14:20
Warans,

Thanks. Currently I am using the same procedure. But when the no of records are more it takes lot of time..

Any other clue from anyone.

Thanks,
NM

shah_bs
14th March 2002, 17:09
I suggest you try the following:

-------------------
Select tdsls041.*
from tdsls041
where tdsls041.orno = :1
wherebind (1, lval(tdsls041.cprj))
selectdo
......
endselect
--------------------


I think it should also be possible replace

where tdsls041.orno = :1

with

where tdsls041._index1 = {:1}

(If this last thing works, you should see appreciable improvement in performance.)


Let me know what works!

P.S. Rather strange requirement, I must say, matching Order Number with Project Code!

crincoli
15th March 2002, 13:41
-------------------
Select tdsls041.*
from tdsls041
where tdsls041.orno = :1
wherebind (1, lval(tdsls041.cprj))
selectdo
......
endselect
--------------------

I think lval(tdsls041.cprj) is evaluated before select, and so it won't work.

Let me know Pietro