IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

-811 SQL Error Code


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Mar 23, 2006 10:43 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top