Tables related by key constraint must both be permanent or both be temporary created with ON COMMIT PRESERVE ROWS

Item Value
SQLCODE -850
Constant SQLE_INVALID_FOREIGN_KEY_TABLE
SQLSTATE 42R02
Sybase error code 1709
ODBC 2 State 42000
ODBC 3 State 42000

Probable cause 

Tables involved in a key constraint relationship must both be permanent user tables or both be temporary tables created with ON COMMIT PRESERVE ROWS. Change the definition of one or both tables using ALTER TABLE.