getFirstRunId {openMpp}R Documentation

Return id of first model run results

Description

Return id of first model run results

Usage

getFirstRunId(dbCon, defRs)

Arguments

dbCon

database connection

defRs

model definition: database rows describing model input parameters and output tables

Details

Return id of first model run results id, it is positive integer. If model does not have any run results (model never executed) then return negative value.

Value

Run id: positive integer on success or negative on if not found.

Note

To run examples you must have modelOne database modelOne.sqlite in current directory

Author(s)

amc1999

References

OpenM++ documentation: http://ompp.sourceforge.net/wiki/

See Also

getLastRunId getModel getTaskIdByName

Examples

  theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full")
  invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended

  # get model by name: use such call if you have only one version of the model
  defRs <- getModel(theDb, "modelOne")

  # get first run id of that model
  runId <- getFirstRunId(theDb, defRs)
  if (runId <= 0L) warning("model run results not found")

  dbDisconnect(theDb)

[Package openMpp version 0.8.1 Index]