I would like to use a SQL stmts like this:
SELECT * FROM tab WHERE key1 LIKE '%<i>variable</i>%'.
Using LIKE in the WHERE clause requieres a character field. But I want to use a vairable...
how should i write that?
thx,
holger
Request clarification before answering.
hi,
data str(100).
data val type i.
now you can dynamically set the value for str..like-->
case flag.
when '1'.
val = value for flag 1.
str = concatenate 'key1 eq ' val into str.
when '2'.
val = value for flag 1.
str = concatenate 'key1 eq ' val into str.
endcase.
SELECT * FROM tab WHERE str.
i hope it will solve your problem.
Message was edited by: Anid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 12 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.