Release Notes


4.11 Migration Issue Regarding Views Defined with Special Registers

Views become unusable after database migration if the special register USER or CURRENT SCHEMA is used to define a view column. For example:

   create view v1 (c1) as values user

In Version 5, USER and CURRENT SCHEMA were of data type CHAR(8), but since Version 6, they have been defined as VARCHAR(128). In this example, the data type for column c1 is CHAR if the view is created in Version 5, and it will remain CHAR after database migration. When the view is used after migration, it will compile at run time, but will then fail because of the data type mismatch.

The solution is to drop and then recreate the view. Before dropping the view, capture the syntax used to create it by querying the SYSCAT.VIEWS catalog view. For example:

select text from syscat.views where viewname='<>'


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]