dm_db_select_nodes Interface

public interface dm_db_select_nodes

Generic nodes select function.


Module Procedures

private function db_select_nodes_array(db, nodes, nnodes) result(rc)

Returns all sensor nodes in allocatable array nodes.

The function returns the following error codes:

  • E_ALLOC if memory allocation 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(node_type), intent(out), allocatable :: nodes(:)

Returned node data array.

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

Number of nodes.

Return Value integer

private function db_select_nodes_iter(db, db_stmt, node) result(rc)

Iterator function that returns all sensor nodes in node. The statement db_stmt must be finalised once finished.

The function returns the following error codes:

  • 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(node_type), intent(out) :: node

Returned node data.

Return Value integer