Browse Source

Añadido señales de alerta cuando se modifique la base de datos.

main
Costa 3 years ago
parent
commit
899daa7e6c
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      RellenarOVBD.R

+ 4
- 0
RellenarOVBD.R

@ -32,6 +32,8 @@ last.num<-next.num+(length(new.nhc)-1)
upd.ovid<-rbind(ovid,data.frame("NHC"=new.nhc, "OVID"=sprintf("OVID%04d",next.num:last.num))) upd.ovid<-rbind(ovid,data.frame("NHC"=new.nhc, "OVID"=sprintf("OVID%04d",next.num:last.num)))
rownames(upd.ovid)<-as.character(1:nrow(upd.ovid)) rownames(upd.ovid)<-as.character(1:nrow(upd.ovid))
upd.ovid<-filter(upd.ovid, NHC %in% new.nhc) upd.ovid<-filter(upd.ovid, NHC %in% new.nhc)
### !! Atención, esto cambia la base de datos:
sqlSave(dta, upd.ovid, tablename="OVID", append = T) sqlSave(dta, upd.ovid, tablename="OVID", append = T)
## Generar código para las nuevas muestras ## Generar código para las nuevas muestras
@ -65,4 +67,6 @@ saveWorkbook(wb,"queryOV.xlsx",overwrite = TRUE)
nsamples<-sqlFetch(dta, "SAMPLES") %>% nrow nsamples<-sqlFetch(dta, "SAMPLES") %>% nrow
upd.samples<-read.xlsx("QuerySamplesOV.xlsx") upd.samples<-read.xlsx("QuerySamplesOV.xlsx")
rownames(upd.samples)<-(nsamples+1):(nsamples+nrow(upd.samples)) %>% as.character rownames(upd.samples)<-(nsamples+1):(nsamples+nrow(upd.samples)) %>% as.character
### !! Atención, esto cambia la base de datos:
sqlSave(dta, upd.samples, tablename="SAMPLES", append = T) sqlSave(dta, upd.samples, tablename="SAMPLES", append = T)

Loading…
Cancel
Save