cancel
Showing results for 
Search instead for 
Did you mean: 

XSJX Query Limitations

Former Member
0 Kudos

Hello,

I'm new to SAP HANA and I am developing a SAPUI5 application now.

I was using xsodata  services as my only way to connect to my DB, but after a while I realized that it is really complected and impossible to perform some complected SELECT queries using just xsodata  even by creating views out of these queries.

So I searched and found XSJS . I started trying it but I had a major problem; some queries simply can not work ! I mean, for example I have a SELECT query which has AVG function in it, it is working perfectly when I'm executing it in on my table on the server but when I am putting it in the xsjs file and try to execute it by

var pstmt = conn.prepareStatement(query);

var rs = pstmt.executeQuery();

it gives me (500 - Internal Server Error) .. I remove the AVG function and everything is working again !!

My questions are :

1) Is there any limitations on the SQL queries inside XSJS files? and if yes, how to know them?

2) Should not be the same syntax as SAP HANA SQL ?

3) What is the reason of my problem, and how can I solve it ?

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

sreehari_vpillai
Active Contributor
0 Kudos

Hi Shadi,

Looks like you are not constructing your query string ( variable query in your example ) . Put a try catch block to surround the below statements and check the error message.

try{

var pstmt = conn.prepareStatement(query);

var rs = pstmt.executeQuery();

}

catch(err)

{

     $.response.setBody(err.message);

}

Sree

Answers (0)