Resolution of unqualified table names
You can handle unqualified
table names in your application by binding user packages with COLLECTION parameters,
or by creating views or aliases.
Use one of the following methods to handle unqualified table names:
- Each user can bind their package with different COLLECTION parameters using
different authorization identifiers by using the following commands:
CONNECT TO db_name USER user_name BIND file_name COLLECTION schema_nameIn this example, db_name is the name of the database, user_name is the name of the user, and file_name is the name of the application that will be bound. Note that user_name and schema_name are typically the same value. Then use the SET CURRENT PACKAGESET statement to specify which package to use, and therefore, which qualifiers will be used. If COLLECTION is not specified, then the default qualifier is the authorization identifier that is used when binding the package. If COLLECTION is specified, then the schema_name specified is the qualifier that will be used for unqualified objects.
- Create a public alias to point to the required table.
- Create views for each user with the same name as the table so the unqualified table names resolve correctly.
- Create an alias for each user to point to the required table.