Skip to Content
0

ODBC Driver for SAP HANA Database - Using STRING_AGG

Dec 23, 2016 at 01:37 PM

111

avatar image

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

10 |10000 characters needed characters left characters exceeded

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

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers