SQL/MX 3.2 Programming Manual for C and COBOL (H06.25+, J06.14+)
Name Resolution, Similarity Checks, and Automatic
Recompilation
HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL—663854-002
8-14
Similarity Check
Examples of similarity check for a view
In this example, at compile-time, the view refers to two tables,
CAT.SCH.TABLE_ONE T1 and CAT.SCH.TABLE_TWO T2. However, at run-time,
the view refers to only one table, PRDCAT.PRDSCH_ONE.TABLE_ONE T1.
Compile-time view:
CREATE VIEW TEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT X1, Y1, X2
FROM CAT.SCH.TABLE_ONE T1, CAT.SCH.TABLE_TWO T2;
Run-time view:
CREATE VIEW PRDTEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT X1, Y1 FROM PRDCAT.PRDSCH_ONE.TABLE_ONE T1;
Thus, view similarity check fails, because of the difference in the number of tables
accessed by the view at compile-time and at run-time.
In this example, the query expressions of the view differ because the projection
lists at compile-time and run-time are different. The projection lists at compile-time
and run-time contains I, J, A and I+1, J+2, B, respectively.
Compile-time view:
CREATE VIEW TEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT I, J, A
FROM CAT.SCH.TABLE_ONE T1, CAT.SCH.TABLE_TWO T2;
Run-time view:
CREATE VIEW PRDTEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT I+1, J+2, B
FROM PRDCAT.PRDSCH_ONE.TABLE_ONE T1,
PRDCAT.PRDSCH_ONE.TABLE_TWO T2;
Thus, similarity check for the view fails.
In this example, the query expressions of the view differs because of the difference
in projection lists at compile-time and run-time. The projection lists at compile-time
and run-time contains I, J, A and I, J, CURRENT_DATE AS A, respectively.
Compile-time view:
CREATE VIEW TEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT I, J, A FROM CAT.SCH.TABLE_ONE T1, CAT.SCH.TABLE_TWO
T2;
Run-time view:
CREATE VIEW PRDTEMP_VIEW ENABLE SIMILARITY CHECK AS
SELECT I, J, CURRENT_DATE AS A
FROM PRDCAT.PRDSCH_ONE.TABLE_ONE T1,
PRDCAT.PRDSCH_ONE.TABLE_TWO T2;
Thus, similarity check for the view fails.










