There are two naming conventions that can be used in DB2 for OS/400: system and SQL. The naming convention used affects the method for qualifying file and table names.
In the system naming convention, files are qualified by library name in the form:
If the file is not explicitly qualified and depending on the SQL operation, either the current library (*CURLIB) or the library list (*LIBL) is used when system naming convention is enabled.
In the SQL naming convention, tables are qualified by the collection name in the form:
If the table name is not explicitly qualified, the default qualifier is the user profile of the job running the SQL statement.
For Net.Data, the default is the SQL naming convention. If system naming convention is desired, insert the following line in the Net.Data initialization file:
You can also set DTW_SQL_NAMING_MODE to SQL_NAMING, which is the same as the default of SQL naming convention.
Note that when a connection is made to a remote AS/400, the SQL Call Level Interface looks for a *SQLPKG object in library QGPL by the name of QSQCLIPKG. If it exists, it is used, but if it does not exist it is created. This SQL package contains all the rules by which the native SQL is accessed. Therefore, the first connection's attributes set the rules that all subsequent connections must follow. One of these attributes is naming convention. If you set the DTW_SQL_NAMING_MODE to conflict with the naming convention in an existing QGPL/QSQCLIPKG on a remote AS/400, the SQL statement in the Web macro results in an SQLCODE of -5016. To avoid this situation, select a naming convention and stick with it. If the QGPL/QSQCLIPKG object exists that is in conflict with the naming convention you have chosen, delete it and issue the Net.Data request again, which will result in the creation of a new QGPL/QSQCLIPKG with the naming convention you require.