cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC Driver for SAP HANA Database - Using STRING_AGG

0 Kudos

Hello all

I liked the LISTAGG on Oracle and now the STRING_AGG on HANA which was introduced either at Revision 70 or 71 - we are now on Rev. 122.

So selecting data in DB02 - SQL Editior works with the following Statement:

select ebeln, ebelp, string_agg(text, '\n\br' ORDER BY LINE ASC ) as text from zbw_stxl group by ebeln, ebelp

I do have installed the HANA ODBC Driver Version 1.00.112.03 on my MS SQL Server and created a linked Server.

This Statement works so far:

select * from openquery (UP1, 'SELECT * FROM SAPSR3.ZBW_STXL ')

Because I thought that the openquery Expression will passthrought the Statement to the source database, i wanted to use the STRING_AGG function in my openquery Statement like follow:

select*fromopenquery (UP1,'SELECT EBELN, EBELP, STRING_AGG(text, '','') AS TEST FROM SAPSR3.ZBW_STXL WHERE TDOBJECT = ''EKPO'' GROUP BY EBELN, EBELP ')

But the OleDB is now returning the following:

OLE DB provider "MSDASQL" for linked server "UP1" returned message "Requested conversion is not supported.".

Msg 7341, Level 16, State 2, Line 1

Cannot get the current row value of column "[MSDASQL].TEST" from OLE DB provider "MSDASQL" for linked server "UP1".

I know there is a more actual ODBC Driver (Think 122) available - but before I triy and error I wanted to ask if anybody already has the newest Driver and experience in this area with linked Server and function STRING_AGG?

Thank you

Roger Heckly

0 Kudos

Hi - just for Information - Updated ODBC to 120 and still it doesn't work.

Accepted Solutions (0)

Answers (0)