on ‎2022 Dec 07 9:42 PM
I am trying to build a SQL query on a table where I use a variable for the table fieldname in teh where clause e.g,
var1 VARCHAR(10) ;
var1 := '"FIELD1"';
select * from TABLE1 where :var1 = 'X' ;
It's not recognising var1 as FIELD1 from TABLE1, can anyone help?
Request clarification before answering.
FYI, I managed to solve this. For anyone looking at this post for an answer, I used an APPLY_FILTER
example..
--lv_whereclause = ':ZZBLKRSNT = ''X''';
lt_result = APPLY_FILTER(ZTEST_TABLE, :lv_whereclause);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.