dm_db_table_exists Function

public function dm_db_table_exists(db, table, exists) result(rc)

Returns whether given table exists in database. The result code is E_NONE if the table has been found, else E_DB_NO_ROWS. The logical result is returned in exists. Pass the enumerator SQL_TABLE_* from dm_sql, for instance:

integer :: rc
logical :: exists

rc = dm_db_table_exists(db, SQL_TABLE_LOGS, exists)

The function returns the following error codes:

  • 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 query result is of unexpected type.
  • E_INVALID if argument table is invalid.

Arguments

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

Database type.

integer, intent(in) :: table

Table enumerator.

logical, intent(out), optional :: exists

Table exists.

Return Value integer


Calls

proc~~dm_db_table_exists~~CallsGraph proc~dm_db_table_exists dm_db_table_exists sqlite3_bind_text sqlite3_bind_text proc~dm_db_table_exists->sqlite3_bind_text sqlite3_finalize sqlite3_finalize proc~dm_db_table_exists->sqlite3_finalize sqlite3_prepare_v2 sqlite3_prepare_v2 proc~dm_db_table_exists->sqlite3_prepare_v2 sqlite3_step sqlite3_step proc~dm_db_table_exists->sqlite3_step