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: 2181
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: 10211
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: 6966
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: 10211
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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