Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section contains information that is specific to the database type Netezza.

 Supported Functions

 The Netezza database can be used with:

  •  sqlexec (APL)

  •  SQL Loader Agent

 For data loading, it is recommended that you use the SQL Loader Agent. You can also use APL function sqlExec for both data loading and unloading. For information on how to use sqlExec with Netezza see the section below, APL Examples. For further details, see also the IBM Netezza Data Loading Guide.

 Preparations

 This section describes preparations that you must perform before attempting to connect to a Netezza database.

 A driver, provided by your IBM contact, is required to access the Netezza database. This driver must be stored on each host (Platform or EC) that will connect to a Netezza database.

For Image Added to access the Netezza database, follow the steps below:

  1. Copy the Netezza files to the directory MZ_HOME/3pp in the Platform or EC.

  2. Restart the Platform and EC for the change to take effect.

Anchor
APL-Examples
APL-Examples

APL Examples

This section gives examples of how to use the APL function sqlExec with a Netezza Database profile.

Info

Example - Load data from an external table on the Netezza database host


Code Block
languagetext
themeEclipse
initialize {
 int rowcount = sqlExec("NETEZZA.NetezzaProfile", 
 "INSERT INTO mytable 
 SELECT * FROM EXTERNAL '/tmp/test.csv' USING (delim ',')");
}
Info

Example - Load data from an external table on the EC host

Code Block
languagetext
themeEclipse
initialize {
 int rowcount = sqlExec("NETEZZA.NetezzaProfile", 
 "INSERT INTO mytable SELECT * FROM EXTERNAL '/tmp/test.csv' 
 USING (delim ',' REMOTESOURCE 'JDBC')");
} 
Info

Example - Unload data to an external table on the EC host

Code Block
languagetext
themeEclipse
initialize {
 int rowcount = sqlExec("NETEZZA.NetezzaProfile", 
 "CREATE EXTERNAL TABLE '/tmp/test.csv' 
 USING (DELIM ',' REMOTESOURCE 'JDBC') 
 AS SELECT * FROM mytable");
}