on 09-05-2013 3:27 PM
This is the important code:
conn = $.db.getConnection();
var query = "UPDATE \"LASVEGAS\".\"lasvegas.data::listener\" 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....
Hi Tobias,
If your Autocommit is not set to true, you must trigger it manually.
More details on documentation:
http://help.sap.com/hana/SAP_HANA_XS_JavaScript_Reference_en/$.db.Connection.html
Regards, Fernando Da Rós
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your replies, adding the line "conn.commit();" after executeUpdate worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, have you tried to do a commit after the executeUpdate Statement ($.conn.commit();)? Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.