NextDB.net

Class net.nextdb.Delete

Object
   |
   +--net.nextdb.Delete

class net.nextdb.Delete


In order to delete 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.

    // You can perform deletes in conjunction with queries.
    // As a security feature, you can only delete rows from
    // the database using an obfuscated key that was returned
    // from a query.  Also the query from which you get the
    // key must have been created with "FOR DELETE" selected.

    var conn = new net.nextdb.Connection("accountName","databaseName");
    var key;
    var query = new net.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 del = new net.nextdb.Delete("TABLE1");
                del.setRowId(key);
                conn.executeDelete(del,
                    function(error){
                        if(error){
                            alert(error.message);
                        } else {
                            alert("ok");
                        }
                    }
                    );
            }
        });


Defined in api.docs.js


Field Summary
 Object rowId
          
 Object tableName
          
 
Constructor Summary
net.nextdb.Delete(tableName,rowId)
           
 
Method Summary
 void setRowId(<String> rowId)
          
 void setTableName(tableName)
          

Field Detail

rowId

Object rowId

tableName

Object tableName

Constructor Detail

net.nextdb.Delete

net.nextdb.Delete(tableName,rowId)

Method Detail

setRowId

void setRowId(<String> rowId)

setTableName

void setTableName(tableName)

NextDB.net

Documentation generated by JSDoc on Mon Mar 29 20:15:50 2010