Hi,
Can anyone of you please explain about SQLCODE=-805. I made a search in the forum but I did not get a proper answer. Please help.
Need help on SQLCODE= -805.
-
- Registered Member
- Posts: 33
- Joined: Fri Jul 05, 2013 11:52 am
Re: Need help on SQLCODE= -805.
What do you mean by "proper answer"? Have you tried the manual? What did you not understand about the explanation?
Regards
Nic
Nic
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Need help on SQLCODE= -805.
You get SQLCODE=-805 when the package corresponding to an SQL statement execution request was not found.
When you compile and bind a program, you get the following:
When you execute your program, out of many at your shop, one of the following can happen:
When you compile and bind a program, you get the following:
- the load module and
- the other is the DB2 package.
- DBRMLIB, but for this discussion this is not relevant.
When you execute your program, out of many at your shop, one of the following can happen:
- You do not pick up the correct version of the load module.
- You pick up the correct version of the load module BUT the correct version of the package cannot be found. There are a few reasons why a package cannot be found.
- It may be bound into a wrong collection and your plan does not have access to it. To fix this, you must fix your BIND command.
- Possibly it was just not there; may be it was deleted. If it is so - to fix this, simply recompile/bind.
- Or the plan you are running under does not have access to the collection that the package lives in. Ask your DBAs to add the collection to your plan.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Registered Member
- Posts: 33
- Joined: Fri Jul 05, 2013 11:52 am
Re: Need help on SQLCODE= -805.
Thanks for the explanation Anuj. This is very useful.Anuj Dhawan wrote:You get SQLCODE=-805 when the package corresponding to an SQL statement execution request was not found.
When you compile and bind a program, you get the following:
Now when you run the program, a COBOL DB2 program, you need to provide a "complete pack of program" and that is the correct combination of same outputs that were created by your compile step. If you'd ever had only a single program on your shop, you don't need what we read ahead but that's not a usual set-up so we read ahead -
- the load module and
- the other is the DB2 package.
- DBRMLIB, but for this discussion this is not relevant.
When you execute your program, out of many at your shop, one of the following can happen:
To avoid all this, a consistency token, in short known as "contoken" is embedded in. When a program is compiled and bound all of its outputs are stamped with the same contoken value. It makes easy to match them later. The contoken gets stamped on the package and if you query the DB2 catalog tables you will find it. As well, the same contoken value gets embedded inside the load module. Along with it, compile date/time also gets stamped inside the load module. Now if DB2 fails to find a match using the contoken value, you get -805.
- You do not pick up the correct version of the load module.
- You pick up the correct version of the load module BUT the correct version of the package cannot be found. There are a few reasons why a package cannot be found.
- It may be bound into a wrong collection and your plan does not have access to it. To fix this, you must fix your BIND command.
- Possibly it was just not there; may be it was deleted. If it is so - to fix this, simply recompile/bind.
- Or the plan you are running under does not have access to the collection that the package lives in. Ask your DBAs to add the collection to your plan.
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Need help on SQLCODE= -805.
Glad that we had been helpful.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute