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 Holger,
You can use 'LIKE' for Character string or variable in
Where clause of Select statement.
Pass the value which needs to be compared into a variable and use that variable in the select statement.
Example:
Data: v_ltext like cskt-ltext value 'abc%abc'.
Select * from CSKT
Into table itab
where ltext like v_ltext.
Regards,
Sudhakar.
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.