dm_db_select_images Interface

public interface dm_db_select_images

Generic images select function.


Module Procedures

private function db_select_images_array(db, images, node_id, sensor_id, target_id, from, to, desc, limit, nimages) result(rc)

Returns images in allocatable array images.

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.

Arguments

Type IntentOptional Attributes Name
type(db_type), intent(inout) :: db

Database type.

type(image_type), intent(out), allocatable :: images(:)

Returned image data array.

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

Begin of time range.

character(len=*), intent(in), optional :: to

End of time range.

logical, intent(in), optional :: desc

Descending order.

integer(kind=i8), intent(in), optional :: limit

Max. numbers of images.

integer(kind=i8), intent(out), optional :: nimages

Total number of images.

Return Value integer

private function db_select_images_iter(db, db_stmt, image, node_id, sensor_id, target_id, from, to, desc, limit, validate) result(rc)

Iterator function that returns images in images. 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_NO_ROWS if no rows are returned.
  • E_DB_PREPARE if statement preparation failed.
  • E_DB_TYPE if returned columns are unexpected.

Arguments

Type IntentOptional Attributes Name
type(db_type), intent(inout) :: db

Database type.

type(db_stmt_type), intent(inout) :: db_stmt

Database statement type.

type(image_type), intent(out) :: image

Returned image 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

Begin of time range.

character(len=*), intent(in), optional :: to

End of time range.

logical, intent(in), optional :: desc

Descending order.

integer(kind=i8), intent(in), optional :: limit

Max. numbers of images.

logical, intent(in), optional :: validate

Validate column types.

Return Value integer