pramod
23rd September 2013, 05:51
Has anyone used the etol() in the where condition of a select statement? For example reading item type like etol(tcibd001.kitm) = 1. I can use like tcibd001.kitm = tckitm.purchase, but just wanted to know if anyone has tried using a function like I mentioned above. Thank you in advance.

bhushanchanda
23rd September 2013, 07:14
Hi,

You can directly use the numeric values in the where clause.

Like,

select
whinr110.kost | Transaction Type
from
whinr110 | Inventory Transactions by Item and Warehouse
where
whinr110.kost = 3 | Transaction Type is receipt

I am not sure if this is what you are looking for, but you can do it without etol() function and without writing the domain value i.e. in above case it would have been whinr110.kost = tckost.receipt, but even if I use whinr110.kost = 3 it works.

Hence, in your case it would be

select
tcibd001.kitm | Item Type
from
tcibd001 | Items - General
where tcibd001.kitm = 1

vamsi_gujjula
23rd September 2013, 12:40
other option

It is also possible to use a pseudo variable in the WHERE clause. The WHEREBIND function is then used to link a value to the pseudo variable. For example:

SELECT ....
WHERE ppmod123.field1 = :1
WHEREBIND(1, 10 + sqrt(a+b))
SELECTDO
....
ENDSELECT