Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2779

Re: getting 500 internal server error when running xsjs file

$
0
0

Hi ,

 

I was able to save the data to hana table by modifying some of the code in xsjs file.

 

/**------------------------------- Register User ---------------------*/

 

 

  //Get the Customer Preferences

  var oReqData  = $.request.parameters.get("registerusr");

  var userData = JSON.parse(oReqData);

 

  if (oReqData === null) { 

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

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

  }

 

  //Get the DB connection and insert data

  var oSQLcon = $.db.getConnection("READ_SRV::an");

 

  var st = oSQLcon.prepareStatement("INSERT INTO \"ID7_SLT\".\"READ_TRL_USERS\" values(?,?,?,?,?,?,?)"); 

  st.setString(1, userData.EMAIL);

  st.setString(2, userData.FNAME);

  st.setString(3, userData.LNAME);

  st.setString(4, userData.COMPANY);

  st.setInteger(5, parseInt(userData.PHONE, 10));

  st.setString(6, userData.PASSWORD);

  st.setString(7, ' ');

  st.execute(); 

 

  //Close the DB connection

  oSQLcon.commit(); 

  oSQLcon.close();

 

  $.response.status = $.net.http.OK;

  $.response.contentType = "text/html";

  $.response.setBody("User saved successfully!");

 

But there is a problem , when i enter the phone number with more than 9 digits. its throwing an error. it is accepting only values less than 9 digits.

 

The backend field type for Phone number is INT.

 

Could anyone help me on this.

 

Regards,

Sivaganesh


Viewing all articles
Browse latest Browse all 2779

Trending Articles



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