Class to import text files into netezza db using external table
setDSN()
ImporterClass$setDSN(DSN_NAME)
DSN_NAME
setExternalTableParams()
ImporterClass$setExternalTableParams(params, append = FALSE)
params
list of parameters
append
wheather append parameter to existing list or replace it
setTableDetails()
ImporterClass$setTableDetails( tableName, finaltablecolumns, inputfilecolumns, insertcolumns, createTable = FALSE )
tableName
name of final table
finaltablecolumns
column list of final table. this is used to make a new table it must be a list sasme as the following list finaltablecolumns=list(name=c('dggid','value'),type=c('bigint','float'))
inputfilecolumns
column list of text files, it must be as following list inputfilecolumns=list(name=c('id','value','dggid'),type=c('varchar(100)','varchar(100)','varchar(100)'))
insertcolumns
The type convertion of tables when copying from external table to distanation table. use the following example insertcolumns='CAST(dggid AS bigint),CAST(value AS float )', NOTE: the order of columns are same as @param finaltablecolumns list and column names are as @param inputfilecolumns
createTable
= FALSE If true it drops previus table if exists and makes a new table
importDirectory()
ImporterClass$importDirectory(path, extention = "*.csv")
path
folder name
extention
= "*.csv" file extentions in folder
importFile()
ImporterClass$importFile(filename)
filename
file name
clone()
The objects of this class are cloneable with this method.
ImporterClass$clone(deep = FALSE)
deep
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## ------------------------------------------------
## Method `ImporterClass$setDSN`
## ------------------------------------------------
## ------------------------------------------------
## Method `ImporterClass$setExternalTableParams`
## ------------------------------------------------
## ------------------------------------------------
## Method `ImporterClass$setTableDetails`
## ------------------------------------------------
## ------------------------------------------------
## Method `ImporterClass$importDirectory`
## ------------------------------------------------
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.