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 for a SELECT query - But only one record in database

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

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Tue Nov 11, 2008 12:55 pm    Post subject: -811 for a SELECT query - But only one record in database
Reply with quote

Hi,
I've a query which is resulting in -811 althought there is only one record in the database.

I've checked the WHERE clause lot of times and made sure the DB2 sub system is correct. If i delete the record and process the next record, it still abends with -811. The program is processing first say 100 records perfectly and is giving -811 for all the records after that.

Please comment.


Thanks.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Tue Nov 11, 2008 1:05 pm    Post subject:
Reply with quote

Anand,

Try executing the same in SPUFI and see if you're getting multiple rows.
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Tue Nov 11, 2008 1:28 pm    Post subject:
Reply with quote

I've executed them. It gives only one row.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue Nov 11, 2008 1:38 pm    Post subject: Reply to: -811 for a SELECT query - But only one record in d
Reply with quote

Quote:
-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

Explanation:

Execution of an embedded SELECT statement or a subselect in the SET clause of an UPDATE statement has resulted in a result table that contains more than one row. Alternatively, a subquery contained in a basic predicate has produced more than one value.

System Action:

The statement cannot be executed.

Programmer Response:

Examine the syntax of the statement to ensure that it contains the proper condition specifications. If the statement syntax is correct, there might be a problem with the data that is causing more than one row or value to be returned when you do not expect it.

SQLSTATE:

21000


the manual is clear and does not give any escape routes....
no offense meant, but I' d rathe trust more DB2 and the manual

You think that the query used inside the program is the same one used
in SPUFI...
but often there are gotchas, and what happens inside a program is not what You think...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Nov 11, 2008 2:09 pm    Post subject:
Reply with quote

lanand_hps,

what is your imbedded sql, please use code/code tags:
http://ibmmainframes.com/faq.php?mode=bbcode
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue Nov 11, 2008 2:14 pm    Post subject: Reply to: -811 for a SELECT query - But only one record in d
Reply with quote

continuation of my previous post..

general consideration ...

using SPUFI what You see is what You get
- no host variables, the values of the where clause are there as constants

inside a program...
well the name tells "host variables" and the content is not always what You would expect...

put displays to see the value of the host variables and You might have big surprises

that' a standard debugging approch, when everything else fails
- no need to be told on a forum icon_biggrin.gif
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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