Generic data points select function.
Returns data points from observations database in dps. This
function selects only responses of error E_NONE, unless argument
error is passed, then only of the given error code.
The function returns the following error codes:
E_ALLOC if memory allocation failed.E_DB_BIND if value binding failed.E_DB_FINALIZE if statement finalisation failed.E_DB_NO_ROWS if no rows are returned.E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed.E_DB_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(dp_type), | intent(out), | allocatable | :: | dps(:) |
Returned data points. |
|
| character(len=*), | intent(in) | :: | node_id |
Node id. |
||
| character(len=*), | intent(in) | :: | sensor_id |
Sensor id. |
||
| character(len=*), | intent(in) | :: | target_id |
Target id. |
||
| character(len=*), | intent(in) | :: | response_name |
Response name. |
||
| character(len=*), | intent(in) | :: | from |
Beginning of time span. |
||
| character(len=*), | intent(in) | :: | to |
End of time span. |
||
| integer, | intent(in), | optional | :: | error |
Response error code. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of data points. |
|
| integer(kind=i8), | intent(out), | optional | :: | ndps |
Number of data points. |
Iterator function that returns data points from observations
database in dp. This function selects only responses of error
E_NONE, unless argument error is passed, then only of the given
error code. The statement db_stmt must be finalised once finished.
The function returns the following error codes:
E_DB_BIND if value binding failed.E_DB_DONE if statement finished.E_DB_PREPARE if statement preparation failed.E_DB_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(db_stmt_type), | intent(inout) | :: | dbs |
Database statement type. |
||
| type(dp_type), | intent(out) | :: | dp |
Returned data point. |
||
| character(len=*), | intent(in) | :: | node_id |
Node id. |
||
| character(len=*), | intent(in) | :: | sensor_id |
Sensor id. |
||
| character(len=*), | intent(in) | :: | target_id |
Target id. |
||
| character(len=*), | intent(in) | :: | response_name |
Response name. |
||
| character(len=*), | intent(in) | :: | from |
Beginning of time span. |
||
| character(len=*), | intent(in) | :: | to |
End of time span. |
||
| integer, | intent(in), | optional | :: | error |
Response error code. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of data points. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |