In this blog post, you’ll learn more about the Sybase Error Local connection ID does not refer to the current database and the reason for receiving this error
Sybase SQL Error Message
Local connection ID does not refer to the current database
Reason for this Error
The specified connection ID is for a connection to a database other than the current database.