View previous topic :: View next topic
|
Author |
Message |
shailendra tripathi
New User
Joined: 05 Jan 2007 Posts: 5 Location: Pune
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
shailendra tripathi
New User
Joined: 05 Jan 2007 Posts: 5 Location: Pune
|
|
|
|
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 |
|
|
|