on 01-02-2014 6:38 PM
Hi,
I have a requirement to concatenate Text in one Column.
Col A (Key) Col B Col C (Text )
101 203 ABC
102 203 DEF
103 203 GHI
I want one row with Text in it.
101 203 ABCDEFGHI
102
103
How would I achieve this in SQL Script Procedure? Sample code ideas would be very helpful.
thanks!
@ak
Use a generated always statement.
GENERATED ALWAY AS concat(A,B)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, I understand what you are asking for now.
1) Loop through column C with a cursor, and concatenate this into a local scalar text variable
2) Issue an update statement on column C against the key of column A
If you need some more help, could you paste the DDL you are using and the code that you wrote so far.
John
Thanks John! I have a Table with these columns which gets replicated from ECC. I tried doing this in BO but its performance issues on the report side. What would be my best solution Create a Script based view just with One table and populate a Separate Col with concatenated Text in it? Or Procedure would work for me in this case? I need a Sample Code for this ...so far appreciate your response on this. @ak
You are drip feeding me information... so you have a scenario with ERP replicated to HANA via SLT.
You want a view exposed to SAP BO which has the first row of the table.
In addition you want one column appended to that view with the concatenation of all the values in one column.
Is that correct? If so can you paste your DDL? Thanks!
John
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.