The select function is established to execute SELECT SQL.
Its return is an instance of the Record class.
var record1 = db.select("helloWorld", "selectUser", {
"country" : "China"
}).sort("years", "asc");
var record2 = db
.select("select * from table_user where country='China' order years asc");
Calling | Returning |
db . select ( groupId , sqlId , params ) | Record |
db . select ( groupId , sqlId , params , jdbcResourceName ) |
db . select ( sql ) |
db . select ( sql , jdbcResourceName ) |
Parameters | Type | Description |
groupId | String | "SubFolder/FileName". SubFolder is relatived from efw.sql.folder. FileName is the name of a SQL xml file. |
sqlId | String | The id of a sql tag in a SQL xml file. |
params | JSON Object |
To send values which is requried by the SQL defined in the SQL xml file.
{"param1":value1,"param2":value2,...}
|
jdbcResourceName | String | To execute SQL in another database resource, but not the default.
|
sql | String | To execute a pure SQL string. |