ADD_VALIDATION_LIST_ENTRY scalar function
The ADD_VALIDATION_LIST_ENTRY scalar function adds an entry to the specified validation list.
The values in a validation list entry are used by specific interfaces that are controlled with validation lists. This function provides a way to add the entries but does not enforce any specific rules.
This function uses the QsyAddValidationLstEntry()--Add Validation List Entry API to add the entry.
The function requires that Option 13 (System Openness Includes) of the IBM i operating system is installed.
Authorization: See Note below.
- validation-list-library
- A character string containing the name of the library that contains the validation list. Can contain the special values of *CURLIB or *LIBL.
- validation-list-name
- A character string containing the name of the validation list.
- validation-user
- A character string containing the name provided by a user when interacting with the IBM i. The name can be up to 100 characters long. This name does not need to correspond to an IBM i user profile name.
- password
- A character string containing the password that corresponds to validation-user. The password can be up to 600 characters long. The value will be encrypted when stored in the validation list.
- entry-data
- A character string containing additional data for the entry. The string can be up to 1000 characters long. This parameter is optional. If it is omitted, there is no additional data associated with validation-user.
The result of the function is an integer. If the add operation is successful, the function returns a value of 0. If the operation returns an error, the function returns the errno value from the API.
Note
This function is provided in the SYSTOOLS schema as an example of how a complex API can be simplified in an SQL scalar function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.
Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.
Example
CREATE VARIABLE MYLIB.VLDL_PW VARCHAR(100);
SET MYLIB.VLDL_PW = 'password for my user access';
VALUES SYSTOOLS.ERRNO_INFO(SYSTOOLS.ADD_VALIDATION_LIST_ENTRY(
VALIDATION_LIST_LIBRARY => 'APPLIB',
VALIDATION_LIST_NAME => 'APPVLDL',
VALIDATION_USER => 'my application user name',
PASSWORD => MYLIB.VLDL_PW));