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

Existence Check Query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Mon Nov 05, 2012 12:06 pm
Reply with quote

Hi,

I have coded as below for existence check.

SELECT 1 INTO :WS-CHECK
FROM table_name
WHERE xyz= :WS-xyz

Is it required to code it as

SELECT 1 INTO :WS-CHECK
FROM table_name
WHERE xyz= :WS-xyz
FETCH FIRST ROW ONLY --- Is this requird?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Nov 05, 2012 12:30 pm
Reply with quote

pshongal wrote:
... Is this requird?

Yes, if your first query returns more than one row and SQLCODE -811 is not handled...
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Mon Nov 05, 2012 2:15 pm
Reply with quote

Thank you Gnanas.
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 SCOPE PENDING option -check data DB2 2
No new posts RC query -Time column CA Products 3
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top