Using the Bulk Import and Export Utilities
Page 8 of 12

bulkFetch

Function

This property sets the size of the bulk fetch for rebuilding any indexes associated with the table; the default value is 16.

Syntax

bulkFetch=intValue

Setting this property to a higher value may speed up index rebuilding but requires more memory. Use the -mx parameter to the java command line to allocate more memory.

Examples of Bulk Import and Export Within SQL-J Statements

-- This imports all columns and rows from
-- mydata3.dat into table1 in slow import mode
INSERT INTO myints SELECT *
FROM NEW COM.cloudscape.tools.FileImport
('/usr/share/data/mydata3.dat')
AS t

-- this imports the first two columns returned by
-- the file importer (whose columns are given the
-- correlation names a, b, and c) using the specified input
-- and control files. The example uses fast import mode.
INSERT INTO table2 PROPERTIES insertMode=bulkInsert
SELECT a, b FROM NEW COM.cloudscape.tools.FileImport(
'file:////Jeeves/share/data/data2.asc',
'file:////Jeeves/share/mapping/data2.ctl')
AS t (a, b, c)

-- Imports the first four columns from the specified file
-- (which are given correlation names)
-- into WorldCupStatistics using the default file
-- format in slow import mode
INSERT INTO WorldCupStatistics
SELECT a, b, c, d FROM NEW COM.cloudscape.tools.FileImport(
    '../cloudscape/demo/programs/tours/scripts/wc_stat.dat')
AS FI(a, b, c, d, e, f, g, h)

-- Imports the first four columns from the specified file
-- (which are given correlation names)
-- into WorldCupStatistics using the default file
-- format replacing the current data
INSERT INTO WorldCupStatistics PROPERTIES insertMode=replace
SELECT a, b, c, d FROM NEW COM.cloudscape.tools.FileImport(
    '../cloudscape/demo/programs/tours/scripts/wc_stat.dat')
AS FI(a, b, c, d, e, f, g, h)

-- use the static method to import data
-- into the WorldCupStatistics Table
CALL FileImport.Import(getCurrentConnection(), 'WORLDCUPSTATISTICS', 'wc_stat.dat');

-- Exports data from the tabletable3 into the file
-- table3.dump using the default file format.
CALL FileExport.Export(getCurrentConnection(), 'APP.table3',
'/temp/table3.dump');

Localization-Related Properties

Cloudscape allows you to set two localization-related properties when working with the Cloudscape tools such as the bulk import and export utilities. For more information, see: