
Add a person to table_colnam using secure function
add_person_to_db.RdAdds a new person to table_colnam using the secure add_person() PostgreSQL function. This works even if the user doesn't have direct INSERT permission on table_colnam.
**Requires**: Database administrator must first run `setup_add_person_function()`
Usage
add_person_to_db(
con,
first_name,
last_name,
nationality = NULL,
institute = NULL,
contact = NULL
)Examples
if (FALSE) { # \dontrun{
con <- call.mydb()
# Add a new person
id <- add_person_to_db(con, "John", "Doe",
nationality = "USA",
institute = "University XYZ")
# Person already exists - returns existing ID
id2 <- add_person_to_db(con, "John", "Doe") # Returns same ID
} # }