Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Unanswered: sqlcode -540 in Sybase

    Hi,

    We have our application in C with Sybase Database. While running the application, at times it thorws an error (sqlcode -540) with error message
    "Schema for table <table-name> has changed since compilation of this query. Please re-execute query."

    This error occurs when it is trying to open select cursors on a particular table. We never changed the schema was during execution, and update statistics on the table was not done during execution.

    Our Sybase version is 11.1.1.

    Does this error has got something to do with the Sybase version?

    Help from anyone is appreciated.
    Thanks
    Ajay

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Hiya cdajay,

    A wild guess, maybe another session might have recompiled the stored proc while this one was calling it.

    Cheers
    Willy

  3. #3
    Join Date
    Jan 2003
    Posts
    4
    Hi Willy,

    Thanks for the suggestion. But we didn't do any recompilation in any other session when this error occurred. Interestingly, this type of error occurs once in 2-3 months.

    Does this happen because of the Sybase version 11.9.2.3 (wrongly mentioned as 11.1.1 in previous mail) that we use?

    Thanks in advance

    Ajay
    Last edited by cdajay; 01-03-03 at 05:49.

  4. #4
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Hiya Ajay,

    This is an genuine error message.

    From what you are saying, this occurs only once every 2-3 months, there might be a possibility that your cron job to recompile objects runs every 2-3 months as well.

    Check that out.

    Cheers
    Willy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •