dm_db_select_beats Interface

public interface dm_db_select_beats

Generic beats select function.


Module Procedures

private function db_select_beats_array(db, beats, limit, nbeats) result(rc)

Returns heatbeats from database in array beats. An optional limit may be passed in limit.

The function returns the following error codes:

  • E_ALLOC if memory allocation failed.
  • E_DB_BIND if value binding 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(beat_type), intent(out), allocatable :: beats(:)

Returned beat types.

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

Max. number of beats.

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

Total number of beats in database.

Return Value integer

private function db_select_beats_iter(db, db_stmt, beat, limit) result(rc)

Iterator function that returns heatbeats from database in beat. An optional limit may be passed in limit. 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_NO_ROWS if no more rows are available.
  • 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(beat_type), intent(out) :: beat

Returned beat type.

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

Max. number of beats.

Return Value integer