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 will the variable contain when SQL code -811 is issued?

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

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Wed Jan 09, 2008 2:44 pm    Post subject: what will the variable contain when SQL code -811 is issued?
Reply with quote

Hi All,

In our application, a query returns two rows. So we get SQL code -811.

My question is,
The SELECT INTO variable will contian the value of first row or second row?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jan 09, 2008 3:30 pm    Post subject:
Reply with quote

before vsn 8, the host variable will be populated with an undetermined result row. Could be the first or the second.

vsn 8 nolonger populates the host variable when issuing a -811.


from vsn 7 you can say 'Fetch first row only', which will avoid the -811. Again, you don't know which one.

If your where clause stipulates a value for the column, then both rows (more than one result row) will contain the same value. If you don't have a where clause for the results column, then you need to add a where clause.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Thu Jan 10, 2008 3:38 pm    Post subject: Reply to: what will the variable contain when SQL code -811
Reply with quote

Hi,

I have tested the -811 condition.It is populating the value in the second row. However this value is not used most of the times and may not be consistent during all the runs.

Syam
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Thu Jan 10, 2008 3:38 pm    Post subject: Reply to: what will the variable contain when SQL code -811
Reply with quote

And i am using DB2 Version 8.1

Syam
Back to top
View user's profile Send private message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Thu Jan 10, 2008 8:42 pm    Post subject:
Reply with quote

In another case the returned rows were 5. In that the values are populated undetermined. In that I am not able say any concrete row number being populated.

I am trying to find the version of my DB2..
Can I find it anywhere within my scope of job or something?or Do i need to check with the DB support group?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jan 10, 2008 8:51 pm    Post subject:
Reply with quote

your pre-compiler listing will tell you the db2 version.
Back to top
View user's profile Send private message
Munish Singla

New User


Joined: 18 Jul 2007
Posts: 21
Location: kolkata

PostPosted: Fri Jan 11, 2008 12:58 am    Post subject: Reply to: what will the variable contain when SQL code -811
Reply with quote

It will contain second row.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jan 11, 2008 1:02 am    Post subject:
Reply with quote

ANYBODY THAT DEPENDS ON DATA FROM AN OPERATION THAT ENDS WITH A ERROR CODE IS ASKING FOR TROUBLE!
Back to top
View user's profile Send private message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Fri Jan 11, 2008 10:48 am    Post subject:
Reply with quote

It seems, it usually fetches second row only icon_sad.gif

I am able to find my DB2 version from the FOOTPRINT option in Endevor Tool.
My DB2 version is 7.1
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 MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 1 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


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