Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
-811 SQL Error Code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nandinihb

New User


Joined: 10 Dec 2005
Posts: 11
Location: b'lore

PostPosted: Thu Mar 23, 2006 10:14 am    Post subject: -811 SQL Error Code
Reply with quote

hi,
how to resolve -811 sql error code in db2?

thanks
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Mar 23, 2006 10:43 am    Post subject:
Reply with quote

Hi,

Reason of code -811 :THE RESULT OF AN EMBEDDED SELECT STATEMENT IS A TABLE OF MORE THAN ONE ROW, OR THE RESULT OF THE SUBQUERY OF A BASIC PREDICATE IS MORE THAN ONE VALUE

Action:
1) Either use cursor
2) Strengthen the where clause so that u get only one row.

Hope it will be helpful
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Thu Mar 23, 2006 11:15 am    Post subject:
Reply with quote

Hi,

-811 is caused when execution of a SELECT has resulted in a result table containing more than one row.

Solution - Look at the syntax of the statement to ensure that it contains the proper condition specifications. If it does, there may be a problem with the data that is causing more than one row or value to be returned.

Best way to avoid duplication is to make the select with Cursor.A cursor is used to retrieve multiple rows in succession from a SELECT statement
Cursor has to be declared in the Working Storage Section and opened before fetching.
Back to top
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Thu Mar 23, 2006 4:59 pm    Post subject:
Reply with quote

Hi,

Host language can handle only 1 row at a time, so if your SELECT statement is selecting more than 1 row without using cursor then you will get -811.

So as mentioned by guptae use cursor or check your condition.

Regards,
Ranjit
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Finding the plan when code compiled u... Ahemad DB2 1 Fri Dec 01, 2017 6:38 pm
No new posts Strange Code amitc23 COBOL Programming 6 Tue Nov 28, 2017 11:25 am
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us