Error 540 with embedded SQL and cursors 
Author Message
 Error 540 with embedded SQL and cursors

Recently, one of our clients has started getting an occasional 540 error with the following message:

SYBASE ERROR -540 (Schema for table 'tablename' has changed since compilation of
this query.  Please re-execute query.)        

I know for a fact that the schema for this table has NOT changed.  What I did find out, however, is that the program getting this error is
doing cursor processing via embedded SQL/C.  I also found out that if you execute an sp_recompile on a table after a cursor is declared but
before it is opened (or re-opened), a 540 error is generated.

The process where the error is occuring is a demon, which periodically re-processes a cursor.  I need the program to deallocate the cursor and
re-allocate it before opening it again.  However, there doesn't seem to be a deallocate cursor function in embedded SQL.  My question is, do
embedded SQL cursors stay allocated for the life of the program?  If not, when are they de-allocated?

Tom Wilson
Management Systems Associates

Sun, 22 Nov 1998 03:00:00 GMT
 [ 1 post ] 

 Relevant Pages 

1. Error number 540

2. Sybase error 540

3. HP 540 Colour Printer Driver

4. Embedded-SQL: i can't properly open cursors

5. embedded SQL:Problem during compilation in embedded sql(MSSQL) with VC++

6. Passing cursor between functions in embedded SQL

7. Embedded SQL Problem: Cursor, Fetch

8. Performance with large Cursors (Embedded SQL/C)

9. Cursors - Packets & Embedded SQL (C precompiler)

10. SLOOOW Cursors in Embedded Sql/C

11. Cursors & embedded SQL

12. Need Help Please , Invalid Cursor Position Error and Cursor Not Open Error

Powered by phpBB® Forum Software