Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2011
    Posts
    29

    Unanswered: Sqlcode=-514, sqlstate=26501

    We have a select statement on a table,While executing this select we are receiving the following error:

    SQLCODE=-514, SQLSTATE=26501

    The cursor name is not in a prepared state

    But We are not using any cursor here and we are executing static sql statement.

    Could not resolve the issue.

    Can anyone please suggest what may be the problem here?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Would have to see you application code to tell you what is wrong. When you say static, does that mean you are using a Stored Procedure or C program with embedded SQL?
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2011
    Posts
    29
    Actually we are executing this query in query editor not through application and also its not for any specific table.Attempt to execute select statement on any table is giving the same error

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by Divya_kamath View Post
    Actually we are executing this query in query editor not through application and also its not for any specific table.Attempt to execute select statement on any table is giving the same error
    If it is a query editor (which for some reason you are keeping the product name secret from us), it is not static SQL.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Jan 2011
    Posts
    29
    Nothing like secret.

    We are trying to execute this query in Squirrel sql client and we are using db2 database

    SELECT * FROM tablename

    resulting in specified error

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by Divya_kamath View Post
    Nothing like secret.

    We are trying to execute this query in Squirrel sql client and we are using db2 database

    SELECT * FROM tablename

    resulting in specified error
    Squirrel does not use static SQL. Since I know your tablename is not really tablename, then I cannot help you. Also, don't know the release of DB2 server, client, etc.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Divya,

    Always post your DB2-server Version and Fixpack, and Operating-System-Name for each new thread.

    In your case, also post your DB2-client name and version, and jdbc driver version.

    Most likely you need to disconnect all applications from the database, and rebind the client packages as directed by the DB2 documentation, with the bindfiles that came with your client.

Posting Permissions

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