Created
October 20, 2023 05:37
-
-
Save krlmlr/425321377c35aab2e0bec16fe7b6a85f to your computer and use it in GitHub Desktop.
Running multiple statements with DBI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(DBI) | |
con <- dbConnect( | |
RPostgres::Postgres(), | |
... | |
) | |
dbExecute( | |
con, | |
"CREATE TEMP TABLE x (a int); CREATE TEMP TABLE y (b int)", | |
immediate = TRUE | |
) | |
#> [1] 0 | |
dbGetQuery(con, "SELECT COUNT(*) FROM y") | |
#> count | |
#> 1 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment