ECLDataset-class: Class '"ECLDataset"'

Description Fields Methods Examples

Description

Creates a DATASET definition. The DATASET declaration defines a file of records, on disk or in memory.

Fields

name:

Object of class character Class name.

datasetType:

Object of class ECLRecord Input record name.

logicalFileName:

Object of class character A string constant containing the logical file name.

fileType:

Object of class character One of the following keywords, optionally followed by relevant options for that specific type of file: THOR/FLAT, CSV, XML, PIPE.

def:

Object of class character ECl definition/code.

Methods

print():

Prints the ECL code.

addExpression(fieldName):

Used to add ECL definitions.

getDatasetType():

Returns input dataset name.

getName():

Returns class name.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  ## Not run: 
    ecl1 <- ECL$new(hostName="127.0.0.1")
    recPerson <- ECLRecord$new(name="Person")
    recPerson$addField("STRING", "code")
    recPerson$addField("STRING", "firstName")
    recPerson$addField("STRING", "lastName")
    recPerson$addField("STRING", "address")
    recPerson$addField("STRING", "stateCode")
    recPerson$addField("STRING", "city")
    recPerson$addField("STRING", "zip")
    ecl1$add(recPerson)
    dsPerson <- ECLDataset$new(name="ds_person", datasetType = recPerson, 
        logicalFileName ="~ds::person", fileType="CSV")
    ecl1$add(dsPerson)
  
## End(Not run)

rHpcc documentation built on May 2, 2019, 11:04 a.m.