Learn R Programming

monitoR (version 1.2)

dbUploadTemplate: Upload Acoustic Templates to a Database

Description

Upload a binary point matching or correlation template list containing one or more templates to tblTemplate in an acoustics database. One or more templates may be indexed by name or position from the template list for upload.

Usage

dbUploadTemplate(templates, which.one, db.name = "acoustics", uid , pwd, analyst, 
locationID = "", date.recorded = "", recording.equip = "", species.code, 
type, ...)

Value

This function is invoked for its side effect, which is to insert the template list into tblTemplate in an acoustics database. Successful upload is marked by a report of the upload time; unsuccessful upload will report any errors encountered.

Arguments

templates

TemplateList object of class binTemplateList or corTemplateList to upload.

which.one

Indexing option for individual templates within the TemplateList object. Indexing may be by name or numerical position. If missing, all templates within the list are uploaded.

db.name

Name of the ODBC connector data source corresponding to the acoustics database.

uid

User ID to allow ODBC connector to connect to database, if not present in ODBC connector.

pwd

Password to allow ODBC connector to connect to database, if not present in ODBC connector.

analyst

Numerical key value corresponding to the user's tblPerson.pkPersonID value in the acoustics database.

locationID

Numerical key value corresponding to the location's tblLocation.pkLocationID value in the acoustics database.

date.recorded

Dates template clip was recorded, in a recognizable POSIX format: YYYY/MM/DD.

recording.equip

Equipment used to record template clip.

species.code

Character value corresponding to the species' tblSpecies.fldSpeciesCode value in the acoustics database; usually a 4, 6, or 8-character code. Codes not in the database will return a cryptic error and cause upload to fail.

type

Character value identifying template type, in c("BIN", "COR"). Some partial matching is performed.

...

Additional arguments to RODBC::odbcConnect.

Author

Jon Katz

Details

dbUploadTemplate assumes a database structure identical to that provided in the acoustics schema. If the username and password are present in the ODBC datasource they do not need to be provided. It is possible to store only the username in the datasource and enter a password, but the reverse will not work.

The following must be true for upload to succeed: The value for analyst must be present in tblPeople.pkPeopleID The value for locationID must be present in tblLocation.pkLocationID the value for species.code must be present in tblSpecies.fldSpeciesCode

See Also

dbDownloadTemplate