Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Met error when trying to use $.db.ResultSet to convert decimal array returned by SQL query

$
0
0

Hi,

 

I met a issue when trying to create my own XS app. Basically, the app tries to do some SQL query and convert returned results to JSON, and one column of returned table from SQL query is "decimal array", I tried to call one of the functions from class $.db.ResultSet to extract data in that decimal array, but it seems like all functions could not do the work.

 

XS engine log says:

InternalError: dberror(getNString): 592 - not supported type conversion: at ResultSet' Convert() (line 45 position 1 in /testload1/tatest.xsjs)

 

getNString is the function I called and I also tried all other functions in ResultSet class.

 

The SQL statement in my app called a SQL function "TM_GET_RELATED_DOCUMENTS" and several of returned columns are "decimal array". Please find this function's document here:

SAP HANA SQL and System Views Reference - SAP Library

 

I put code I wrote here:

var con = this.connection.prepareStatement( "SELECT * FROM TM_GET_RELATED_DOCUMENTS( DOCUMENT ' sap' LANGUAGE 'EN' MIME TYPE 'text/plain' SEARCH \"FILECONTENT\" FROM \"SYSTEM\".\"TATEST\" RETURN PRINCIPAL COMPONENTS 3 CORRELATION TOP 5 ) ");
con.execute();
var list = [];
var result = con.getResultSet();
while(result.next())
{     list.push({     rank : result.getNString(1),     total_term_count : result.getNString(2),     correlatetions : result.getNString(3) //Error happens here      // more properties..     });
}        return list;

 

Does any of you guys know anything about "decimal array" data type and how to extract it by XS APIs or other javascript code?


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>