on 02-14-2019 5:50 AM
Hello ABAP Gurus,
I have an SQL query where I need to use 'NOT LIKE' operation along with CONCAT operation in INNER JOIN, but CONCAT is not accepting more than 2 Parameters.
Below is the Code snippet,
Error message says " SQLSCRIPT message:wrong number of arguments in function invocation.
Actually I want to use NOT LIKE for below purpose:
I just followed the below thread for writing this query.
https://stackoverflow.com/questions/23276344/like-operator-in-inner-join-in-sql
Please guide, how to proceed or where I am wrong.
Thanks,
Sijin
Use two CONCATs
CONCAT( ( '%' , zsd_catalog_price.zz_catalog ), '%' )
Two things:
1. Use the CODE button in the editor for posting code. Right click "paste as plain text".
2. Why have a fieldname in a Z table that begins ZZ - why not a meaningful name, like "catalog"?).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First very thanks Matthew for your time and suggestion,
I will check your suggestion for sure,
But in the below Stackoverflow link they are doing it in one single Concatenate ( 3 parameters ),
https://stackoverflow.com/questions/23276344/like-operator-in-inner-join-in-sql
SQL should be SQL everywhere right ? ( Correct me if I am wrong )
And for your below concern,
2. Why have a fieldname in a Z table that begins ZZ - why not a meaningful name, like "catalog"?).
I cent percent agree with you, actually this field was added by another developer and he moved out of our project ( of course not for this reason 😉 ). Since the solution was already in use by the time I pitched in , so thought of not touching it.
Thanks,
Sijin
SQL should be SQL everywhere right ?
Wrong. For a start, while SQLs across different databases are very similar and largely standardised, they can have different functions. CONCAT for HANA SQL only allows two parameters.
However, the main point you really need to understand is that this isn't SQL! It's openSQL which is part of the ABAP programming language. If you read the documentation for CONCAT in the ABAP help, you'll see it only accepts 2 parameters.
If in doubt, read the documentation. I've been programming ABAP since 1997 and I still refer to the ABAP help on an almost daily basis.
Things are not simple, even openSQL is now named ABAP SQL (>= 7.53) 😉
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.