Generic observations select function.
Returns observations in observs, with optional node id, sensor id,
target id, from, to. By default, observations are returned in
ascending order, unless desc is passed and .true.. The maximum
number of observations may be passed in limit.
The stub is .true., neither receivers nor requests are read from
database.
The total number of observations is returned in optional argument
nobservs.
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_TYPE if returned columns are unexpected.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| type(observ_type), | intent(out), | allocatable | :: | observs(:) |
Returned observation data. |
|
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| character(len=*), | intent(in), | optional | :: | sensor_id |
Sensor id. |
|
| character(len=*), | intent(in), | optional | :: | target_id |
Target id. |
|
| character(len=*), | intent(in), | optional | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of observations. |
|
| logical, | intent(in), | optional | :: | stub |
Without receivers, requests, responses. |
|
| integer(kind=i8), | intent(out), | optional | :: | nobservs |
Total number of observations (may be greater than limit). |
Iterator function that returns observations in observ, with
optional node id, sensor id, target id, from, to. By default,
observations are returned in ascending order, unless desc is
passed and .true.. The maximum number of observations may be
passed in limit. The statement db_stmt must be finalised once
finished.
The stub is .true., neither receivers nor requests are read from
database.
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(observ_type), | intent(out) | :: | observ |
Returned observation type. |
||
| character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
| character(len=*), | intent(in), | optional | :: | sensor_id |
Sensor id. |
|
| character(len=*), | intent(in), | optional | :: | target_id |
Target id. |
|
| character(len=*), | intent(in), | optional | :: | from |
Beginning of time span. |
|
| character(len=*), | intent(in), | optional | :: | to |
End of time span. |
|
| logical, | intent(in), | optional | :: | desc |
Descending order. |
|
| integer(kind=i8), | intent(in), | optional | :: | limit |
Max. number of observations. |
|
| logical, | intent(in), | optional | :: | stub |
Without receivers, requests, responses. |
|
| logical, | intent(in), | optional | :: | validate |
Validate column types. |