In this blog post, you’ll learn more about the Sybase Error Query has an ambiguous table reference between prepare and open cursor (%2). %1 and the reason for receiving this error
Sybase SQL Error Message
Query has an ambiguous table reference between prepare and open cursor (%2). %1
Reason for this Error
SA allows a base and temp table to both have the same table name. In some places, such as when a temp table is created in a stored procedure between the describe and open, IQ can find the base table in the describe and the temp table in the open, giving inconsistent results.