From 3b8a4c0657324ecf2ad657b183fd746a485b6b22 Mon Sep 17 00:00:00 2001 From: Costa <47926492N@ICO.SCS.local> Date: Mon, 24 Jan 2022 14:58:07 +0100 Subject: [PATCH] Correcting some workflow positions. Changing sqlDropLast to sqlLastDrop to avoid errors with sqlDrop. --- Docs/sqlFunctions-doc.Rmd | 6 +++--- sqlFunctions.R | 2 +- workflow.R | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Docs/sqlFunctions-doc.Rmd b/Docs/sqlFunctions-doc.Rmd index 5f00f51..e7e5544 100644 --- a/Docs/sqlFunctions-doc.Rmd +++ b/Docs/sqlFunctions-doc.Rmd @@ -18,7 +18,7 @@ knitr::opts_chunk$set(echo = TRUE) Removes from Database the last (or the amount specified) entry. ### Usage -sqlDropLast(conn, tablename, droplast=1, dbtype=NULL) +sqlLastDrop(conn, tablename, droplast=1, dbtype=NULL) ### Arguments Argument|Description @@ -37,12 +37,12 @@ Invisibly for success (and failures cause errors). ### Examples ```r dta<-odbcConnect("test") -sqlDropLast(dta, "TableTest") +sqlLastDrop(dta, "TableTest") ``` ### Function ```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 == "OVID") %>% nrow > 0){dbtype<-"OV"} diff --git a/sqlFunctions.R b/sqlFunctions.R index c13e39e..5de1ca1 100644 --- a/sqlFunctions.R +++ b/sqlFunctions.R @@ -1,6 +1,6 @@ require(RODBC) -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 == "OVID") %>% nrow > 0){dbtype<-"OV"} diff --git a/workflow.R b/workflow.R index c474b60..af7c49f 100644 --- a/workflow.R +++ b/workflow.R @@ -6,13 +6,13 @@ sqlInitialize() ## Asegurarse de que la variable file sea la que nos corresponde: file -# Crear copia de seguridad -sqlBackUp() - # Inicializar conexión dta<-odbcConnectAccess2007(access.file = file, pwd = .rs.askForPassword("Enter password:")) +# Crear copia de seguridad +sqlBackUp() + ## Importamos los NHC de las muestras nuevas nhc.test<-read.xlsx("queryOV.xlsx", sheet = "NHC") %>% pull(NHC)