Output_db-class: Outputs saved in the data preparation program in data base's...

Description Fields Methods

Description

Outputs saved in the data preparation program in data base's tables

Fields

conn

: connection of the data base

data

: data that is going to be saved in the data base

query

: query

FUN_DB

: fun used in function DBConnectWrite (MyConSCDIRwrite)

lastmonths

: parameter from function MyAppend

datecolumn

: parameter from function Myappend

FUN_DB

: fun used in function DBConnectWrite (MyConSCDIRwrite)

table

: name of the data base's table used to save the data (to be added by the user)

Methods

f_DBConnectWrite(...)

function DBConnectWrite() from MyFunnew.R script in data preparation program (a source must be done beforehand to MyFun.R script)

By defaut : DBConnectWrite( conn, data, table, FUN_DB, ... )

Example

LogWrite <- DBConnectWrite( SCDataBase, QVlocs, 'PAR_LOC_geoMapping', MyConSCDIRwrite ) is now replaced by

LogWrite <- Output_db( conn = SCDatabase, data = QVlocs, table = 'PAR_LOC_geoMapping', FUN_DB = MyConSCDIRWrite, process = 'SLA' )$f_DBConnectWrite()

f_Myappend()

function Myappend() from MyFunnew.R script in data preparation program (a source must be done beforehand to MyFun.R script)

By defaut : Myappend(conn, data, table, datecolumn, lastmonths)

Example

LogWrite <- Myappend(SCDataBase, ISL, 'cal_isl', 'DATE' , (pstmnths2run+1) ) is now replaced by

LogWrite <- Output_db( conn = SCDataBase, data = ISL, table = 'cal_isl', datecolumn = 'DATE', lastmonths = (pstmnths2run+1), process = 'ISL' )$f_Myappend()

f_dbSendUpdate(...)

function dbSendQuery() from DBI package.

By defaut : dbSendUpdate( conn, query, ...)

Example

dbSendUpdate( SCDataBase, 'INSERT INTO sla_history SELECT * FROM slatemp' ) is now replaced by

Output_db( conn = SCDatabase, query = 'INSERT INTO sla_history SELECT * FROM slatemp', table = 'sla_history', process = 'SLA' )$dbSendUpdate()

f_dbWriteTable(...)

function dbWriteTable() from DBI package.

By defaut : dbWriteTable( conn, table, data, ... )

Example

dbWriteTable(SCDataBase, 'PAR_LOC_geoMapping', QVlocs, row.names = FALSE, append = FALSE,overwrite = TRUE, date = TRUE, ora.number = ORANUMBER) is now replaced by

Output_db( conn = SCDataBase, table = 'PAR_LOC_geoMapping', data = QVlocs, process = 'Total_Supply' )$f_dbWriteTable( row.names = FALSE, append = FALSE,overwrite = TRUE, date = TRUE, ora.number = ORANUMBER )


Pablo-Lopez-Sfi/dependenciesMap documentation built on June 30, 2020, 2:53 p.m.