Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1281
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
No new posts Can we create REXX ouput in an Excel ... upendrasri CLIST & REXX 3 Wed Jan 17, 2018 8:19 pm
No new posts CICS web service from DB2 Triggers or... kiranprasad DB2 1 Wed Dec 20, 2017 11:10 am
No new posts How to create issuer certificate? :'( vasanthz All Other Mainframe Topics 1 Sat Nov 18, 2017 5:14 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us