[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

SQL Error

Posted on 2000-01-07
6
Medium Priority
?
334 Views
Last Modified: 2012-06-27
SQL error -514 is being returned in a program. Definition says the cursor is not prepared. Please explain the meaning of this and what I need to look for to fix it.
0
Comment
Question by:peneric
6 Comments
 

Expert Comment

by:VoiceOfDissent
ID: 2333190
What environment are you using, and do you have a sample of your source code, or at least the SQL statements?
0
 

Author Comment

by:peneric
ID: 2333208
sql is being used in cobol/mvs enviroment. return code is generated in a call statement.
0
 
LVL 9

Expert Comment

by:david_levine
ID: 2334970
I'm assuming you are using DB2. It's been a while so if my suggestion doesn't help, let me know and I'll look into it in more detail.

Before you open a cursor, you need to define it so it knows what parameters are being passed and what the result set returned will look like. So before you open a cursor, you need to prepare it. Look at where you are getting the open cursor. There should be a name that refers to a cursor definition and there should be a prepare somewhere in the program for that as well.

Verify there is a prepare statement, that it's being executed.

David
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 3

Expert Comment

by:P_S_Price
ID: 2354750
DB2/400 Implementation (which should be similar to DB" on MVS) requires that you issue the following in the correct sequence. (You might also want to use some whenever clauses as well)

'Declare C1 Cursor for Select * from MYtable ... (etc etc)

Open C1...

Fetch C1.....

etc etc
0
 

Author Comment

by:peneric
ID: 2358981
Thank you for the information. I am trying to run down the declaration. It sounds like this will be the answer to my problem
0
 
LVL 3

Accepted Solution

by:
P_S_Price earned 200 total points
ID: 2360595
Who gets the points?
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question