Configuring SQL parameters

NSM service designers can configure SQL parameters in the NSM service template XML. SQL parameter values are validated when they are submitted and before the service is run.

Procedure

As the NSM service designer use the following example as a guide to configuring SQL parameters:
<databaseConnection>
	<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
	<url>jdbc:oracle:thin:@test.example.com:testdb2</url>
	<username>oracleuser</username>
	<password>password</password>
</databaseConnection>
<sqlParameters>
	<sqlParameter>
		<name>SOURCEROUTETABLE</name>
		<sql>select servername from task where uniqueid = 3</sql>
	</sqlParameter>
</sqlParameters>
Note: The <sqlParameters> and </sqlParameters> elements encapsulate one or more <sqlParameter> elements.
Note: The <sqlParameters> element will use the database connection as specified in the <dataBaseConnection> element and associated tags as shown in the example to access the database on which to execute the SQL query.
  1. Enter the required SQL parameter name in the <name> tag associated with each instance of the <sqlParameter> XML element. In the example one SQL parameter is defined: SOURCEROUTETABLE.
  2. Enter the required SQL select statement in the <sql> tag associated with each instance of the <sqlParameter> XML element. In the example one SQL select statement is defined: select servername from task where uniqueid = 3.
    The SQL is executed on the database connection that is located in the selected implementation at service execution time.

    Observe the following points when working with SQL parameters:

    • SQL parameter values are validated when they are submitted and before the service is run.
    • SQL parameters can be used as both global and local parameters in a NSM service template.