| 15 | |
| 16 | From the excel table loaded, we create a temporary table corresponding to the new dam. |
| 17 | These might not correspond to those already in the database. |
| 18 | lb.tempmerge is the merge between the table coming from excel and the new ROE database. |
| 19 | |
| 20 | {{{#!r |
| 21 | aaouvtemp=data[,c("dep","modif","ouv_rinom","ouv_id","ouv_libelle")] |
| 22 | sqldf( |
| 23 | "DROP TABLE IF EXISTS lb.aaouvtemp" |
| 24 | ) |
| 25 | |
| 26 | sqldf("create table lb.aaouvtemp as select * from aaouvtemp ") |
| 27 | # je vais rechercher les tableaux ROE mais dans l'autre base correspondant à ces ouvrages |
| 28 | |
| 29 | roetemp<-sqldf( |
| 30 | "SELECT * from roe_v4.roe", |
| 31 | dbname="eda2.2", |
| 32 | host="localhost", |
| 33 | password=passwordlocal) |
| 34 | colnames(data)[c(31:35)]<-c("Mortalite.Francis.70.cm","Mortalite.Francis.18.cm", |
| 35 | "Mortalite.kaplan.70.cm","Mortalite.kaplan.18.cm","Nb.turbine.entree") |
| 36 | tempmerge<-merge(roetemp,data, by.x="cdobstecou",by.y="ouv_id") |
| 37 | sqldf("DROP TABLE IF EXISTS lb.tempmerge") |
| 38 | sqldf("CREATE table lb.tempmerge as select * from tempmerge") |
| 39 | }}} |