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 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: 2276
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: 10256
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: 6967
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: 10256
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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