Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us