Update

Query to update data of a table in SQL:

-------Update jobs table-------
UPDATE Candidate_Job cj, Employers e, Jobs j 
SET cj.Status = 'canceled', j.Title ='ABC'
WHERE cj.JobId = j.Id AND j.EmployerId = e.Id AND e.CompanyName = 'FPT Software' AND j.Title = 'Business Analyst';

dbAPI for CouchDB usage:

var dbAPI = require('./dbAPI-server').dbAPI;
                         
dbAPI(input, function (output) {
    //Handle output
});

with the input:

input = {
    "metadata": {
        "dbinfo": {
            "DBMS": "couchdb",
            "cFile": "../dbAPI-server/config/dbinfo.couchdb.json"
        }
    },
    "data": {
        "format": "text",
        "szSQL": "UPDATE Candidate_Job cj, Employers e, Jobs j SET cj.Status = 'canceled', j.Title ='ABC' WHERE cj.JobId = j.Id AND j.EmployerId = e.Id AND e.CompanyName = 'FPT Software' AND j.Title = 'Business Analyst';"
    }
}

To execute the SQL create query in other DBMS, change the "DBMS" name from couchdb to neo4j, redis, mysql or sqlite. Then change the cFile to corresponding DBMS configuration file.

Support features:

  • Neo4j: not support ORDER BY & LIMIT in Update query.
  • Redis: supported by rediSQL module