Class nextdb.Update
Object
|
+--nextdb.Update
- class
nextdb.Update
In order to update a certain row you need to know the key for the row. This is a security precaution that data can only be updated and deleted by encrypted keys.
var conn = new nextdb.Connection("accountName","databaseName");
var key;
var query = new nextdb.Query("QUERY1");
conn.executeQuery(query,
function(rows,error){
if(error){
alert(error.message);
} else {
//get a specific obfuscated key
key=rows[0].TABLE1.PK;
var update = new nextdb.Update("TABLE1");
var paramMap = {
"first_name" : "Bob"
"last_name" : "Jones"
};
update.setParameters(paramMap);
update.setRowId(key);
conn.executeUpdate(update,
function(error){
if(error){
alert(error.message);
} else {
alert("ok");
}
}
);
}
}
);
Defined in api.docs.js
|
Field Summary |
Object |
table
|
table
Object table
nextdb.Update
nextdb.Update(<String> tableName)
setParameters
void setParameters(<Object> map)
Parameters:
map - -required collection of name/value pairs, this is a plain old javascript object. example:
var parameters = new Object();
parameters.fname="Brent";
parameters.lname="Brent";
parameters.email="brenthamby@someserver.com";
update.setParameters(parameters);
setRowId
void setRowId(<String> rowId)
Parameters:
rowId - -required used to specify the row to update.
Documentation generated by
JSDoc on Fri Apr 1 10:54:23 2011