Goto: Documentation Home
The load command allows you to load external data files into GDS.
Syntax
- Load Package
Loads a package definition. Not yet released for production use.
- Load Table TableName [ from ] file 'FileName' [ Format Descriptors ... ]
Loads the data to be used by TableName thereby defining the contents of this table. It does not
actually write into database tables however.
- Load into Table TableName [ from ] file 'FileName'
[ Format Descriptors ... ]
[ Columns Descriptors ... ]
Load data into TableName and store it permanently in the database. You must specify the command as "load into table" and
then the target tablename, failure to specify all three keywords will mean the data does not load permanently into the database.
Format Descriptors
This argument defines the format of the file and columns.
- format { }
This keyword sets the general file format and overall processing method.
- column delimiter { tab | comma | Value-Expression }
This keyword sets the character used to seperate the individual columns in the file
- header count NNN
Specifies that the first line of the file contains column headers for the data.
- header skip NNN
Sets a number of lines to skip before processing the file. The skip count is AFTER the header line
- input { permanent | perms | remains | temporary | temp }
Specifies whether the file will remain on the disk for the forseeable future (at least until the GDS Service restarts)
A permanent file allows GDS to refer to the specified file directly to retrieve data, while a temporary file forces
GDS to copy data out of the file.
Column Descriptors
This argument defines the format and handling of each individual column
Syntax: map Column Name [ position NNN ]
Column Name defines the output column name to be loaded in the target table.
The position keyword is optional and if not specified is the next position to be used from the source file,
after use this
next counter is incremented. If you specify the position keyword for a column then all columns defined after
that point use the position set as a base.
Examples
Load a CSV type file into a table in an incremental fashion. This might be used where the input file
contains only a few records to be added to the output table, without losing the current stored data in the table.
load into table MyOutputTable from file 'MyFiles*.csv' format csv column delimiter comma header skip 3
map sampledate position 0
map skey
map raw_count position 5
map prime_count
atend rename '*.done';