Skip to Content
Former Member
Sep 05, 2013 at 02:27 PM

XS Engine SQL Update doesn't write to DB


This is the important code:

conn = $.db.getConnection();

var query = "UPDATE \"LASVEGAS\".\"\" SET \"isActive\" = '0' WHERE \"ID\" = ?";

var pstmt = conn.prepareStatement(query);

pstmt.setString(1, listener_id);

var updateCount = pstmt.executeUpdate();

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

$.response.setBody("Success!<br />"+updateCount+" rows affected.");

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

I run it on XS engine and get "Success! 1 rows affected." as a result. But when I look to the DB, nothing changed. If I run the exact same SQL query in the SQL console in HANA Studio it works. I'm always using the same user....