Retrieve id from a table matching query

get.id(table, colnames, values, con, create = FALSE, dates = TRUE)

Arguments

table

name of table

colnames

names of one or more columns used in where clause

values

values to be queried in fields corresponding to colnames

con

database connection object,

create

logical: make a record if none found?

dates

Ignored. Formerly indicated whether to set created_at and updated_at timestamps when `create` was TRUE, but the database now always sets them automatically

Value

will numeric

Author

David LeBauer

Examples

if (FALSE) { # \dontrun{
pftid <- get.id("pfts", "name", "salix", con)
pftid <- get.id("pfts", c("name", "modeltype_id"), c("ebifarm.salix", 1), con)
} # }