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
 

 

Need help to create one QMF proc

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

New User


Joined: 05 Jan 2007
Posts: 5
Location: Pune

PostPosted: Thu Apr 22, 2010 7:46 pm    Post subject: Need help to create one QMF proc
Reply with quote

Hi All,

Actually i have to create a qmf proc and the flow is like

1) select A from owner.tablename
where fielda = :value and
fieldb = ... so on

2) if sqlcode (record found) = 0

3) then perform an update on another table

4) else throw an error message

i am clear with how to supply value from proc to query but not sure how i can check this sqlcode and then do the update.

can somebody help me on this ???
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Fri Apr 23, 2010 5:39 pm    Post subject:
Reply with quote

I don't see how QMF proc would do this, but I'm pretty sure you can write an update on one table with a exists-where clause

Code:
update ...
from tab1 A

where exists (select * from tab2 B where B.col = &hv ...)
and A = &hv
Back to top
View user's profile Send private message
shailendra tripathi

New User


Joined: 05 Jan 2007
Posts: 5
Location: Pune

PostPosted: Mon Apr 26, 2010 11:07 am    Post subject:
Reply with quote

guys here is the stuff to do that

"GET GLOBAL(ROW_CNT = DSQAO_NUM_FETCHED"
IF ROW_CNT = 1 THEN

After running the select query we check for DSQAO_NUM_FETCHED, this will be zero if no record available.
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
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am
No new posts New PROC not reflecting in prod even ... Musab Ahmed CA Products 9 Tue Mar 15, 2016 12:45 pm
No new posts How to create/edit/update a new GDG V... karthikbalakumar8 JCL & VSAM 2 Fri Feb 05, 2016 6:35 pm


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