Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

HANA XS

$
0
0

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.setContentType("text/plain"); 

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

  } 

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

  if (val1 === null) { 

     $.response.setContentType("text/plain"); 

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

  } 

  var output = {}; 

  output.data = []; 

  var conn = $.db.getConnection();

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

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

 

  st.setString(1,id); 

  st.setString(2,val1); 

  st.executeQuery();

  st.execute(); 

  conn.commit(); 

  var record = []; 

  record.push(id); 

  record.push(val1); 

  output.data.push(record); 

  conn.close(); 

  $.response.setContentType("text/json"); 

  $.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.


Viewing all articles
Browse latest Browse all 3184

Trending Articles



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