DB2 Version 10.1 for Linux, UNIX, and Windows

enable_MQFunctions - Enable WebSphere MQ functions command

Enables DB2®WebSphere® MQ functions for the specified database and validates that the DB2WebSphere MQ functions can be executed properly. The command fails if WebSphere MQ and WebSphere MQ AMI have not been installed and configured.

Authorization

One of the following authorities:
  • CREATE_EXTERNAL_ROUTINE authority on the database and at least one of the following authorities:
    • If the schema name of the function does not refer to an existing schema, IMPLICIT_SCHEMA authority on the database
    • If the schema name DB2MQ or DB2MQ1C exists, CREATEIN privilege on the schema
  • DBADM

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-enable_MQFunctions--n--database--u--userid--p--password------>

>--+-------+--+------+--+------------------+--+-------------+--->
   '-force-'  '-echo-'  '-xml--+---------+-'  '-c -clobSize-'   
                               '-xmlSize-'                      

>--+------------+--+-------------+-----------------------------><
   '-novalidate-'  '- v -+-all-+-'   
                         +-0pc-+     
                         '-1pc-'     

Command parameters

–n database
Specifies the name of the database that you want to enable.
–u userid
Specifies the user ID to connect to the database.
–p password
Specifies the password for the user ID.
–force
Optional. The use of this option allows the utility program to ignore the existing MQ UDFs. In other words, the program drops any existing functions, before recreating any MQ UDFs. Without this option, the command will not proceed after it finds that the MQ UDFs already exist.
–xml xmlSize
Optional. This is for defining the XML versions of the 0pc functions. This option has no effect if the -v 1pc option is specified.

The xmlSize specifies the length of XML data. The minimum length is 1 byte. The maximum length is 100M. The default is 1M. You can specify the length as n (number of bytes), nK (length in kilobytes), or nM (length in megabytes).

–c clobSize
Optional. Specifies the length of CLOB data. The minimum length is 1 byte; this is the default. The maximum length is 100M. You can specify the length as n (number of bytes), nK (length in kilobytes), or nM (length in megabytes).
–novalidate
Optional. This specifies that there will not be any validation of the DB2 MQSeries® functions.
–v
Optional. This is used for transactional and non-transactional user-defined function support. The values can be either all, 0pc, or 1pc. When you specify 0pc, the enablement creates schema db2mq. If you specify 1pc, then the enablement creates schema db2mq1c. If you specify all, then the enablement creates all schemas under user-defined functions (db2mq and db2mq1c). If you do not specify this option, the enablement defaults to the all option.
–echo
Optional. Prints the detailed SQL used to create the UDFs or diagnostic information.

Examples

The following example enables the transactional and non-transactional user-defined functions. The user connects to the database SAMPLE.
   enable_MQFunctions -n sample -u user1 -p password1
In the next example, the user connects to the database SAMPLE. The example creates DB2MQ1C functions with schema DB2MQ1C.
   enable_MQFunctions -n sample -u user1 -p password1 -v 1pc

Usage notes

The DB2 MQ user-defined functions run under the schemas DB2MQ or DB2MQ1C which are automatically created by this command. Before executing this command:
  • Ensure that WebSphere MQ and WebSphere Application Messaging Interface (AMI) are installed, and that the version of WebSphere MQ is 5.1 or higher.
  • Ensure that the environment variable $AMT_DATA_PATH is defined.
  • If you want to use transactional MQ UDFs, make sure that the database is configured for federated operations. Do this with the following command
       update dbm cfg using federated yes 
  • Change the directory to the cfg subdirectory of the DB2PATH
On UNIX:
  • Use db2set to add AMT_DATA_PATH to the DB2ENVLIST.
  • Ensure that the user account associated with UDF execution is a member of the mqm group.
  • Ensure that the user who will be calling this command is a member of the mqm group.
Note: AIX® 4.2 is not supported by MQSeries 5.2.