Skip to contents

Load collection from 'Birdscan MR1' 'SQL' database.

Usage

getCollectionTable(dbConnection, dbDriverChar, timeInterval = NULL)

Arguments

dbConnection

A valid database connection.

dbDriverChar

This was the name of the driver, and is now automatically detected, therefore it should be omitted into the future.

timeInterval

Null An optional vector of timestamps (either as Date or POSIXct) to limit the data retrieved from the collections table. The filtering is done based on the original radar timezone.

Value

A dataframe with the collection table

Author

Fabian Hertner, Birgen Haest, Bart Kranstauber

Examples

if (FALSE) { # \dontrun{
# Set server and database settings
# ===========================================================================
dbServer = "MACHINE\\SERVERNAME" # Set the name of your SQL server
dbName = "db_Name" # Set the name of your database
dbDriverChar = "SQL Server" # Set either "SQL Server" or "PostgreSQL"

# Open the connection with the database
# ===========================================================================
dsn = paste0(
  "driver=", dbDriverChar, ";server=", dbServer,
  ";database=", dbName,
  ";uid=", rstudioapi::askForPassword("Database user"),
  ";pwd=", rstudioapi::askForPassword("Database password")
)
dbConnection = RODBC::odbcDriverConnect(dsn)

collectionTable = getCollectionTable(dbConnection)
} # }