Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.32 KB

db.change.md

File metadata and controls

40 lines (32 loc) · 1.32 KB

db.change

The change function is established to execute INSERT UPDATE or DELETE SQL. The return is the count of modefied records.

Sample

db.change("helloWorld", "DeleteUser", {
	"country" : "China"
});
var count = db.change("delete * from table_user where country='China'");

API

CallingReturning
db . change ( groupId , sqlId , params )Number
db . change ( groupId , sqlId , params , jdbcResourceName )
db . change ( sql )
db . change ( sql , jdbcResourceName )
ParametersTypeDescription
groupIdString"SubFolder/FileName". SubFolder is relatived from efw.sql.folder. FileName is the name of a SQL xml file.
sqlIdStringThe id of a sql tag in a SQL xml file.
paramsJSON Object To send values which is requried by the SQL defined in the SQL xml file.
{"param1":value1,"param2":value2,...}
jdbcResourceNameStringTo execute SQL in another database resource, but not the default.
sqlStringTo execute a pure SQL string.