dbAdd_device: Add devices to 'device' table

Description Usage Arguments Value See Also Examples

View source: R/db_write.R

Description

dbWriteTable_device requires a correct device model id while dbAdd_device derives that from the device model name.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dbAdd_device(
  conn,
  dev_name,
  devmod_name,
  dev_identifier = NULL,
  dev_comment = NULL
)

dbWriteTable_device(
  conn,
  dev_name,
  devmod_id,
  dev_identifier = NULL,
  dev_comment = NULL
)

Arguments

conn

Database connection.

dev_name

String vector of name of device.

devmod_name

String vector of name of model.

dev_identifier

String vector of device identifiers, e.g. serial numbers.

dev_comment

String vector of additional comments.

devmod_id

Integer vector of device_model ID.

Value

Data frame of newly added rows.

See Also

dbAdd_device_uncalibrated for adding a device that does not require calibration to both device and calibration_state

Other custom dbWriteTable functions: dbAddCorrection_station_adlershof(), dbAddCorrection_station_patagonia(), dbAdd_calibration_state(), dbAdd_device_model(), dbAdd_integration(), dbAdd_measurand(), dbAdd_physical_quantity(), dbAdd_station_adlershof(), dbAdd_station_patagonia(), dbWriteTable_device_manufacturer(), dbWriteTable_device_type(), dbWriteTable_integration_type(), dbWriteTable_person(), dbWriteTable_quality_flag(), dbWriteTable_site()

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
con <- dbConnect_klimageo()
dbWriteTable_device_manufacturer(con, "TSI")
dbWriteTable_device_type(con, "thermometer")
dbWriteTable_device_model(con, "THERMO1000", 1, 1)
dbWriteTable_device(con, "My first THERMO1000", 1, "NCC1701-T")
dbDisconnect(con)

## End(Not run)

sebschub/klimageodb documentation built on Sept. 25, 2021, 4:16 p.m.