IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

-811 for a SELECT query - But only one record in database


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Tue Nov 11, 2008 1:05 pm
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
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 11, 2008 1:38 pm
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
Reply with quote

lanand_hps,

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 11, 2008 2:14 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top