powered by
Generate a PostgreSQL CREATE PROCEDURE statement, optionally execute the statement if con is not NULL.
createPROCEDURE( name, args = NULL, or_replace = FALSE, language = "SQL", definition, con = NULL )
A string, PostgreSQL CREATE PROCEDURE statement; or the results retrieved by DBI::dbSendQuery after executing the statement.
A string, the "name" parameter for PostgreSQL CREATE PROCEDURE.
A named list, names are the argument names, values are strings with the argument data types.
TRUE/FALSE, if TRUE, adds "OR REPLACE" to PostgreSQL CREATE PROCEDURE statement.
A string, the "language" parameter for PostgreSQL CREATE PROCEDURE.
A string, the "definition" parameter for PostgreSQL CREATE PROCEDURE.
A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery.
createPROCEDURE( name = "sample", args = list(a = "INTEGER", b = "TEXT"), definition = "INSERT INTO tbl(col1, col2) VALUES (a, b);" )
Run the code above in your browser using DataLab