on 06-27-2015 5:53 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.