kusaha
15th July 2005, 12:35
I tried to use LIKE in WHERE clause with the variable as an operand2 but I could not complie it, e.g.,
where tiitm001.dsca like :desc
The error message said :desc is not expected.
Note: I pass the value of :desc from screen.
thanks.
kusaha
loveneesh
15th July 2005, 13:27
HI
"LIKE" only can be used when you comparing with a variable having wildcards *
Example where field1 = Ram*
You can not use variable with LIKE.
However You can do like this
where tiitm001.dsca =:desc
klixy23
15th July 2005, 13:36
It works also with variables. See example:
string like.str(30)
...
like.str = chr$(34) & ".*[" & toupper$(refa.search(1;1)) & tolower$(refa.search(1;1)) & "]" & strip$(refa.search(2)) & ".*" & chr$(34)
query.extension = "tdsls041.orno refers to tdsls040 " & "and tdsls040.refa like " & like.str
zoom.to$(sub.sess, Z.SESSION, "refa.search", "", 0)
frigyesg
15th July 2005, 14:00
long sql.x
sql.x = sql.parse("select tiitm001.* " &
"from tiitm001 " &
"where tiitm001.dsca like " & chr$(34) & ".*" & strip$(dsca.f) & ".*" & chr$(34))
sql.exec(sql.x)
while (sql.fetch(sql.x) = 0)
...
endwhile
kusaha
16th July 2005, 04:28
Hi Frigyes,
Your script is working for me.
Many Thanks,
kusaha