Enabling SQL functions support in a database

You can enable IBM® SQL Extensions toolkit query support by registering the SQL Extensions functions and API.

Before you begin

Install the SQL Extensions toolkit.

Procedure

  1. Log in to the Netezza Performance Server system with the nz user account.
  2. Change to the following directory, where dir is the directory into which you extracted the files:
    cd dir/libnetcrypto/version
    
  3. Issue the following command, specifying the database name and, optionally, the schema name for which you want to define the SQL Extensions functions and the Netezza Performance Server user account and password of the user who will own the functions:
    ./install -d dbname -schema schemaname 
     -u username -W password
    Output follows:
    
    Installing libnetcrypto to schema schemaname of database dbname in 
    unfenced mode: 
    ............................................... Done
    

    If your database name uses spaces or mixed-case letters, as in myDatabase, make sure that you specify double quotation marks (" ") around the database name and escape the quotation marks. For example, specify ./install -d \"myDatabase\" -u user -W password.

    For Netezza Performance Server Release 7.0.3 or later systems that have multiple schema support enabled, you can use the -schema option to specify the schema to which you want to add the functions. If you specify a schema, it must exist in the database, and the user must have access to the schema; otherwise, the command returns an error. If you specify the -schema option and the Netezza Performance Server system does not support multiple schemas in a database, the command returns an error stating that the option is not supported. If you do not specify a schema or if you did not set the NZ_SCHEMA variable, the command installs the functions in the default schema for the database.

  4. Issue the following command, where dir is the directory into which you extracted the files:
    cd dir/libnetxml/version
    
  5. Issue the following command, specifying the database name and, optionally, the schema name for which you want to define the SQL Extensions functions and the Netezza Performance Server user account and password of the user who will own the functions:
    ./install -d dbname -schema schemaname 
     -u username -W password
    Output follows:
    
    Installing libnetxml to schema schemaname of database dbname in 
    unfenced mode: 
    ............................................ Done
    

Results

The installation commands usually take approximately 1 minute to run. The commands define the SQL Extensions Toolkit functions and register them in the specified database.

The Netezza Performance Server user account that you specified becomes the owner of the functions. Netezza Performance Server administrators can manage the SQL Extensions functions as objects in the Netezza Performance Server database, and users who have permission to use the SQL Extensions functions can include them in queries.

The ./install commands store the software licenses in the /opt/nz/licenses/sqlext_toolkit directory. If the commands display the error Failed to install licenses into '/opt/nz/licenses/sqlext_toolkit'. Try to log in as root user, log in as root and rerun the ./install commands to install the kit and the associated license files.