Evaluesdata

This function defines a filtering condition on a database query. The condition is expressed in SData where syntax.

This function is only valid inside a Where clause of a database instruction (For, Filter, File, Link).

Syntax

Where evalueSData(EXPRESSION, VARIABLES, COLUMNS)

Example

Local File MYTABLE [MYT]Local Char VARS(20)(1..3), COLS(20)(1..3)VARS(1)="country" : VARS(2)="city" : VARS(3)="total"COLS(1)="[MYT]COUNTRYCODE" : COLS(2)="[MYT]CITYNAME" : COLS(3)="[MYT]AMOUNT"# The conditionFilter [MYT] Where evalueSData(& "(city in 'London','Paris') and (total between 1 and 10) and country ne 'BE'"& , VARS, COLS)# is equivalent toFilter [MYT] Where find(CITYNAME,'London','Paris') and (AMOUNT>=1 and AMOUNT<=100) and COUNTRYCODE<>"BE"

Comments

This function only supports the following subset of the SData Query language:

KeywordDescriptionExample
ltless thanamount lt 5000
gtgreather thanamount gt 3000
leless or equalamount le 4500
gegreater or equalamount ge 7800
eqequalamount eq 3000
nenot equalamount ne 3000
between ... and...between two valuesamount between 20 and 30
incontained in a list of valuesamount in (3,14,15,9,26)
likematches a string patternname like '%PONT%'
andlogical andamount ne 300 and amount ne 500
orlogical oramount eq 300 or amount eq 500
absabsolute valueabs(amount) eq 6
asciiASCII code of first characterascii(countrycode) eq 32
charsingle char from ASCII codecountrycode eq char(32)
divdivisionamount div 2 eq 3
left(str,len)leftmost `len` characters from str; `str` if less than `len` charactersleft(name,3)="Doe"
lower(str)converts str to lower caselower(name)="doe"
upper(str)converts str to upper caselower(name)="DOE"
modmodulusnumber mod 2 eq 0
mulmultiplicationamount mul 3 eq 15
notnegationnot (amount eq 3)
powpoweramount pow 3 eq 125
right(str,len)rightmost `len` characters from `str`; `str` if less than `len` charactersright(name,2)='oe'
substring(str,index,len)substring starting at `start` and containing `len` characters; start is 1-basedsubstring(name,4,5)='ti'

See also

ExecSql