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
 

 

What does this mean Sqlcode Error -811?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
madlui56
Currently Banned

New User


Joined: 08 Aug 2006
Posts: 61
Location: Philippines

PostPosted: Tue Jun 26, 2007 12:28 pm    Post subject: What does this mean Sqlcode Error -811?
Reply with quote

What does this mean and solution for this?thanks
Back to top
View user's profile Send private message

guptae

Moderator


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

PostPosted: Tue Jun 26, 2007 12:39 pm    Post subject:
Reply with quote

Hi There,

It means that u try to insert a row which is voilating unique index clause

Code:
-811 THE RESULT OF AN EMBEDDED SELECT STATEMENT OR A SUBSELECT IN THE     
       SET CLAUSE OF AN UPDATE STATEMENT IS A TABLE OF MORE THAN ONE ROW,
       OR THE RESULT OF A SUBQUERY OF A BASIC PREDICATE IS MORE THAN ONE 
       VALUE   


Please download abend assist from the site
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Jun 26, 2007 1:29 pm    Post subject:
Reply with quote

Hi,
you can even get -811 in an embedded SQL SELECT, if your query returns more than one row. The description is as follows.

Execution of an embedded SELECT statement has resulted in a result table containing more than one row. Alternatively, a subquery contained in a basic predicate has produced more than one value.

--Parag
Back to top
View user's profile Send private message
edsellouie

New User


Joined: 13 Sep 2007
Posts: 1
Location: toronto

PostPosted: Sat Sep 15, 2007 1:47 am    Post subject:
Reply with quote

In your application, you may have to declare a CURSOR to resolve this issue. If you're expecting more than 1 row during a SELECT, then you need to have a CURSOR declared before you FETCH each record until there are no more records.

If you don't expect more than one row, then you have to make sure your WHERE clause would retrieve unique records from the specified columns.

...hope this helps...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 15, 2007 2:30 am    Post subject:
Reply with quote

Here is an interesting article about this subject that I read recently
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Tue Sep 25, 2007 8:03 pm    Post subject:
Reply with quote

Hi ,

If you want only row , you can use FETCH FIRST ROW ONLY to your Query , so that you can avoid -811 also reduce the CPU cost by avoiding of unncessary rows were fetched from table .

Code:
Eg :

Select column1 , column2
From tablename
where column3 = 'value'
Fetch first  row only
Back to top
View user's profile Send private message
Raghavendra P K

New User


Joined: 24 Aug 2007
Posts: 24
Location: bangalore

PostPosted: Tue Oct 23, 2007 4:37 pm    Post subject: Reply to: What does this mean Sqlcode Error -811?
Reply with quote

Hi ,

Change your where clause to fetch the records based on the Primary key.This will not give you -811 error. If you read a table based on the primary key you will not get multiple records.
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 -> ABENDS & Debugging 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 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 Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am


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