Key constraint between temporary tables requires a primary key (not unique constraint)

Error constant SQLE_INVALID_FOREIGN_KEY_INDEX
ODBC 2 state 42000
ODBC 3 state 42000
Severity 16
SQLCODE -865
SQLSTATE 42R03
Sybase error code 1709
 Probable cause