on 07-25-2020 12:50 PM
Hello Folks,
How to replace double quotes " with single ' quotes in AMDP?
I tried this way SELECT REPLACE (:lv_String, '"', '''') "replace" FROM DUMMY; but it's not worked for me, getting below error.
String is '( Material EQ "RMME03" OR Material EQ "RM122" )'
Expecting result is `( Material EQ 'RMME03' OR Material EQ 'RM122' )`.
is there any ways? could you please help me on this?
Thanks & Kind Regards,
Bhargava
The error message doesn't say that you have an error with REPLACE, it says that the filter in APPLY_FILTER is invalid:
SQLScript APPLY_FILTER: Invalid filter: '( Mat EQ ''A'' OR Mat EQ ''B'' )'
Probably it's because EQ is invalid in SQL for HANA. Use = instead:
( Mat = 'A' OR Mat = 'B' )
Note that maybe you were distracted by the presence of consecutive single quotes in the error message which made you think that HANA considers two single quotes, but in fact I guess it's just doubled for the output of the error message because if you had used a literal instead of a variable for APPLY_FILTER, you would have entered with two consecutive single quotes, like this:
result = APPLY_FILTER( tablename, '( Mat = ''A'' OR Mat = ''B'' )' )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rossi,
Yes, you are right.
I just found out that after my detailed debugging 😥.
Anyway thanks for the your response.
Thanks,
Bhargava
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.