powered by
Generate a PostgreSQL CREATE TRIGGER statement, optionally execute the statement if con is not NULL.
createTRIGGER(name, when, event, on, for_each_row = FALSE, func, con = NULL)
A string, PostgreSQL CREATE TRIGGER statement; or the results retrieved by DBI::dbSendQuery after executing the statement.
A string, the "name" parameter for PostgreSQL CREATE TRIGGER.
A string, the "when" parameter (BEFORE, AFTER, INSTEAD OF) for PostgreSQL CREATE TRIGGER.
A string, the "event" parameter (INSERT/UPDATE/DELETE/TRUNCATE) for PostgreSQL CREATE TRIGGER.
A string, the "table_name" parameter for PostgreSQL CREATE TRIGGER.
TRUE/FALSE, if TRUE, adds "FOR EACH ROW" to PostgreSQL CREATE TRIGGER statement.
A string, the function call to be executed by the PostgreSQL CREATE TRIGGER.
A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery.
createTRIGGER( name = "sample_trigger", when = "AFTER", event = "INSERT", on = "sample_table", for_each_row = TRUE, func = "function_sample()" )
Run the code above in your browser using DataLab