SQL/MX Programming Manual for Java
SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java—523726-003
4-28
Similarity Check
Similarity Check Criteria
During a similarity check, the SQL/MX executor compares the compile-time version of 
a table with its run-time version. For the similarity check to pass:
•
Both tables must have the same table type (key-sequenced or entry-sequenced).
•
Both tables must be either audited or nonaudited.
•
Both tables must have the same number of columns. The similarity check fails if 
the total number of columns is different, even if the referenced columns in the 
statement are the same for both tables.
•
All corresponding columns in both tables must have the same:
°
Name
°
Data type, length, precision, and scale
°
NULL attribute (Both columns must be either NULL or NOT NULL.)
°
DEFAULT clause (For user-specified values, the columns must have the same 
default value. For SQL/MP floating-point columns, the same default value at 
run time might not always match the compile-time value, causing the similarity 
check to fail.)
•
Both tables must have the same number of key columns. Corresponding key 
columns must have the same:
°
Position, offset, and column number
°
Column attributes
•
If a DML statement uses an index, the run-time table must have an index that has 
the same attributes as the index that was used by the compile-time table. For an 
index on the run-time table to be considered similar to the compile-time index:
°
Both must be either unique or nonunique.
°
Both must have the same keytag value (SQL/MP indexes). (See the CREATE 
INDEX statement in the SQL/MP Reference Manual for details about the 
keytag specification of an index. If an index is created without specifying the 
keytag, for the indexes of old and new tables to match, they must have been 
created in the same sequence.)
°
Both must have the same number of key columns.
°
Both must have the same key column attributes.
•
For a SELECT statement, the tables must not have any unique indexes. If the 
tables have unique indexes, the similarity check fails.










