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

Error while inserting record from XSJS

$
0
0

Hi,

 

I have created table using the following definition.

1.png

 

When I insert record from SQL console it is working perfectly.

 

But when I do the same from XSJS it throws the error as

 

found the following errors:

===========================

InternalError: dberror(PreparedStatement.execute): 598 - failed to execute the external statement: failed to execute at remote: peer=127.0.0.1:30103: unhandled exception (line 14 position 1 in /tryouts/monissha/projects/poc/services/demo.xsjs)

 

The xsjs code is as follows,

 

var conn;

var pstmt;

var rs;

 

 

conn = $.db.getConnection();

pstmt = conn.prepareStatement('INSERT INTO  "SAPHANA_ROI"."Scenario" VALUES ("SAPHANA_ROI"."ScenarioId".NEXTVAL, ?, ?, ?)');

pstmt.setString(1, $.session.getUsername());

pstmt.setString(2, '');

pstmt.setString(3, '');

 

 

pstmt.execute();

conn.commit();

 

 

$.response.setBody(0);

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

pstmt.close();

conn.close();

 

Help me out in resolving this issue.

 

Thanks & Regards,

Monissha


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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