View previous topic :: View next topic
|
Author |
Message |
nandinihb
New User
Joined: 10 Dec 2005 Posts: 11 Location: b'lore
|
|
|
|
hi,
how to resolve -811 sql error code in db2?
thanks |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
KS
New User
Joined: 28 Feb 2006 Posts: 91 Location: Chennai
|
|
|
|
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 |
|
|
ranjitbhingare
New User
Joined: 30 Nov 2005 Posts: 94 Location: PUNE
|
|
|
|
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 |
|
|
|