bumbaermail
22nd September 2008, 14:42
Hello,
My requirement is as following
query.extension = "toupper$(tcmcs080.dsca) like " & chr$(34) & toupper$(temp.string) & chr$(34)
[I know this is an syntax error. But how to get the same type of functionality]
Thanks & Regards
Hitesh Shah
22nd September 2008, 18:21
Normally tcmcs tables are small . So using main.table.io / after.read section expr.compile IN operator (which just works like LIKE operator) , u can restrict the records to display easily and effectively .
rahul.kolhe22
23rd September 2008, 07:04
Hello bumbaermail,
Try using quoted.string function, hope it may help you. I would try to use as given below.
"toupper$(tcmcs080.dsca) like " & quoted.string(toupper$(temp.string))
after that
call the function rebuild.query(), May work, or may need to refresh the screen.
:rolleyes:
Regards
Rahul
bumbaermail
23rd September 2008, 09:49
Hello Hitesh,
Thanks a lot. The problem has been solved.
Hello Rahul,
toupper$/tolower$ cant be used in LHS. It will give syntax error. Anuway, thanks a lot to you also.
Bumba
Hitesh Shah
24th September 2008, 20:10
In baan IV the quoted.string function does not work . If however this works in ur version , there is a good case to use query.extension with quoted.string bcos this solution can work even for bigger tables also .
To eliminate requirement of toupper$ u need to convert the user entered pattern to a new pattern just before query.extension e.g. ".AbCd.* to ".*[aA][bB][cC][dD].*" .
long ctr ,ascval
for ctr = 1 to len(old.pattern)
ascval = asc(old.pattern(ctr;1))
if ascval >= 65 and <= 90 or ascval >= 97 and <= 122 then
newpattern = newpattern & "[" & tolower$(old.pattern(ctr;1)) & toupper$(old.pattern(ctr;1)) & "]"
else
newpattern = newpattern & old.pattern(ctr;1)
endif
endfor
Do give feedback bcos current understanding is that LIKE clause along with variable can only be used in dynamic query . That will change .