5. Data Loading : Initial Data Load : vwload Utility
 
Share this page                  
vwload Utility
The vwload utility reads data from files, directly appending data blocks to the database bypassing the SQL layer.
The utility can be run on the server that runs Vector, in which case the database files must be available locally to the server. You can also run the vwload utility from a remote machine.
Data files must be in a consistent character set encoding in order to fully load into Vector. If the files are not using UTF8 encoding then you can pass the encoding as a parameter into vwload and it will load the data correctly.
Below is an example of using the vwload utility.
In a database called test we create a table called region:
CREATE TABLE region
( r_regionkey INTEGER not null,
  r_name CHAR(25) not null,
  r_comment VARCHAR(152) not null
);
To load the following set of data in a local data file region.tbl:
0|AFRICA|Continent of the elephants
1|AMERICA|Both North and South America
2|ASIA|Where tigers live
3|EUROPE|Many languages are spoken here
4|MIDDLE EAST|Sunny and very warm
5|AUSTRALIA|For goodness sake, please don’t leave us out
use the following statement:
vwload -t region test region.tbl
The vwload utility has options for error handling, date formats, use of enclosures and escape character, and so on. For more information, refer to the Vector User Guide. At present, time and timestamp fields must use the ANSI data representation to load correctly:
hh24:mi:ss for time fields
yyyy-mm-dd hh24:mi:ss.ffffff for timestamp fields