Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Can't display output of select statement

$
0
0

Hi,

 

My SQL statement returns me this output. SQL.png

 

However when I run this piece of code, I don't see any output

 

function displayPeople(){

 

  var body='';

 

 

  try{

 

 

  $.response.setBody('Creating connection');

 

  var conn = $.db.getConnection();

  var pStmt;

 

  pStmt = conn.prepareStatement('SELECT FIRST_NAME,LAST_NAME,POSITION FROM UAA."SkillBase::addPeople"');

 

  $.response.setBody('Query String'+pStmt);

 

 

  var rs = pStmt.executeQuery();

 

  while(rs.next())

  {

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

  $.response.setBody('<html><title></title><body><table><tr><th>First Name</th><th>Last Name</th><th>Position</th><tr>');

 

  $.response.setBody('<tr>'+rs.getString(1) +'</tr>');

  $.response.setBody('</body></html>');

 

 

  }

 

 

  rs.close();

  pStmt.close();

  conn.close();

  }

 

SQL_Output.JPG

 

Thanks in advance


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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