SqlQuery
SQL query information from the server.
Example:
var sql_query = KQ.Query.SqlQuery.getInstance();
console.log(sql_query);
try {
var options = {
url: 'http://172.16.1.157:8699/KQGis/rest/services/zy',
sql: "select distinct " + "XZBM" + " from " + "$$" + 145 + "$$",
};
sql_query.queryAsync(options,
function query_good () {
console.log('query_good');
var data = sql_query.data();
console.log('sql query data.length:' + data.length);
data.forEach(function (d) {
console.log(d.properties);
})
},
function query_error () {
console.log('query_error');
});
}
catch (e) {
console.log('catch error:' + e);
}
Static Method Summary
| Static Public Methods | ||
| public static |
Get instance object(Singleton mode) |
|
Method Summary
| Public Methods | ||
| public |
Get data |
|
| public |
Get last error message |
|
| public |
Whether server return error |
|
| public |
queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> SQL query information from the server. |
|
Static Public Methods
Public Methods
public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source
SQL query information from the server.
Params:
| Name | Type | Attribute | Description |
| options | Object | SQL query options |
|
| options.url | String | Service url |
|
| options.startindex | Number | Start index of result |
|
| options.reqcount | Number | Upper limit of result |
|
| options.sql | String | SQL statement |
|
| function_good | function(): null | The function will run after querying successfully. |
|
| function_error | function(): null | The function will run after querying unsuccessfully. |
Reference
Source