|
@ -18,7 +18,7 @@ knitr::opts_chunk$set(echo = TRUE) |
|
|
Removes from Database the last (or the amount specified) entry. |
|
|
Removes from Database the last (or the amount specified) entry. |
|
|
|
|
|
|
|
|
### Usage |
|
|
### Usage |
|
|
sqlDropLast(conn, tablename, droplast=1, dbtype=NULL) |
|
|
|
|
|
|
|
|
sqlLastDrop(conn, tablename, droplast=1, dbtype=NULL) |
|
|
|
|
|
|
|
|
### Arguments |
|
|
### Arguments |
|
|
Argument|Description |
|
|
Argument|Description |
|
@ -37,12 +37,12 @@ Invisibly for success (and failures cause errors). |
|
|
### Examples |
|
|
### Examples |
|
|
```r |
|
|
```r |
|
|
dta<-odbcConnect("test") |
|
|
dta<-odbcConnect("test") |
|
|
sqlDropLast(dta, "TableTest") |
|
|
|
|
|
|
|
|
sqlLastDrop(dta, "TableTest") |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
### Function |
|
|
### Function |
|
|
```r |
|
|
```r |
|
|
sqlDropLast<-function(conn, tablename, droplast=1,dbtype=NULL){ |
|
|
|
|
|
|
|
|
sqlLastDrop<-function(conn, tablename, droplast=1,dbtype=NULL){ |
|
|
if(sqlTables(conn) %>% filter(TABLE_NAME == "UMID") %>% nrow > 0){dbtype<-"UM"} |
|
|
if(sqlTables(conn) %>% filter(TABLE_NAME == "UMID") %>% nrow > 0){dbtype<-"UM"} |
|
|
if(sqlTables(conn) %>% filter(TABLE_NAME == "OVID") %>% nrow > 0){dbtype<-"OV"} |
|
|
if(sqlTables(conn) %>% filter(TABLE_NAME == "OVID") %>% nrow > 0){dbtype<-"OV"} |
|
|
|
|
|
|
|
|