Skip to Content
author's profile photo Former Member
Former Member


Hello all, I am new to HANA.

I am currently using hana trial version.

I have created XS application, and it was execeuted successfully, by creating hello.xsjs, xsaccess, xsapp files.

I have created a table called TEST in my inbuilt schema, and also created xsjs file in the following way,


function getDataFromTable(){

var id = $.request.parameters.get("id");

if (id === null) {


$.response.addBody("id is null!");


var val1 = $.request.parameters.get("val1");

if (val1 === null) {


$.response.addBody("val1 is null!");


var output = {}; = [];

var conn = $.db.getConnection();

conn.prepareStatement("SET SCHEMA \"xxxxxxxxx\"").execute();

var st = conn.prepareStatement("INSERT INTO \"xxxxxxxtrial.p1234567.hello","TEST\" values(1,K)");






var record = [];





$.response.addBody(JSON.stringify(output)); }

along with this , also created xsaccess, xsprivileges, xsapp, TEST.hdbtable,model_access.hbd role files .


model_access.hbdrole ---------- (role xxxxxxxxxtrial.p1234567.hello::model_access {

application privilege: xxxxxxxtrial.p1234567.hello::Basic;


But when I am trying to run the xsjs file, I am unable to see the table and inserted values , it is showing me blank page.

Could you please help me.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 28, 2015 at 05:46 AM

    Hello Vinni,

    there are several issues in your coding:

    • $.response.setContentType("text/plain"): setContentType is no method of the response object, instead set the property -> $.response.contentType="text/plain"
    • $.response.addBody("id is null!"): addBody is no method of the response object, instead use method setBody -> $.response.setBody("id is null!")
    • conn.prepareStatement("INSERT INTO \"xxxxxxxtrial.p1234567.hello","TEST\" values(1,K)"):
      • not clear here what your table should be here. In case your table name is "TEST" in package "xxxxxxxtrial.p1234567.hello" than use table name "xxxxxxxtrial.p1234567.hello::TEST"
      • also the values "(1, K)" are somehow fixed here, because you are setting the values with the setString method of the statement you have to use placeholder in your statement
      • Statement can look like following: conn.prepareStatement("INSERT INTO \"xxxxxxxtrial.p1234567.hello::TEST\" values(?,?)");
    • Furthermore: Do you have defined a role which gives you the INSERT privilege on your table?

    Best Regards,


    Add a comment
    10|10000 characters needed characters exceeded

    • Where is the call of function "getDataFromTable" in your Hello.xsjs? Do you set in your new version any response after your insert statement? The line with "st.executeQuery()" can be removed because it is not necessary for the insert.

      Maybe you can set at the end a response body like a string "ok" to check if anything is returned and your script is at least executed.

  • Posted on Oct 28, 2015 at 05:14 AM

    hi vinni,

    you can check host file under the folder etc

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.