Procedure
This topic shows some examples of ways that you can handle file naming conflicts for user-defined tables. Suppose that an application executes the following CREATE TABLE statement:
CREATE TABLE T (PK INT NOT NULL PRIMARY KEY, A INT)
Once this statement is executed, DB2 Everyplace will create the following two files for table T:
If you create another table and use the name iT, DB2 Everyplace will create two additional files: DSY_iT (data) and DSY_iiT (index). The index file for table T and the data file for table iT are in conflict because they both have the same name. Both files are named DSY_iT. To avoid this problem, DB2 Everyplace supports file name mapping. That is, the file names will be completely created and managed by DB2 Everyplace. To use this feature, applications must set the connection attribute and it must be executed prior to the creation of the first table. For example, in CLI:
SQLSetConnectAttr(hdbc, SQL_ATTR_FILENAME_FORMAT, (SQLPOINTER)SQL_FILENAME_FORMAT_83, 0)
Or in Command Line Processor:
DISABLE LONG FILENAME
Once this command is executed and the first table is created, the resulting files will be for table T:
Související koncepce
Související úlohy