View previous topic :: View next topic
|
Author |
Message |
bashir ahmad
New User
Joined: 11 May 2013 Posts: 6 Location: canada
|
|
|
|
I select db2 table row based on input file to check the row existance then updated table successfully.
I displayed columns before update which shows correct but when I display columns after update, it doesn't show the values whereas the selected row is updated!!!
Q. Should I select the table again to display column values after
update??? pl reply thanks.
Bashir |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Bashir,
Welcome to IBMMAINFRAMES.com
Yes, you need execute select statement again to see the updated values, i am not sure how you are displaying the columns after-update now.
If you don't want to execute second SELECT statement, you can try this FINAL TABLE technique.
Thanks,
Sushanth |
|
Back to top |
|
|
bashir ahmad
New User
Joined: 11 May 2013 Posts: 6 Location: canada
|
|
|
|
1. I use select the updated table again to display the the result "After updated row", but I never used the FINAL TABLE technique to avoid second select after update. Can you pl send a brief example, thanks.
2. I have other following issue also:
a) I use left outer join for table A and B while declare cursor with hold (in
procedure div not in working-storage section). Table a has foreign key
ie P-key to B.
but Table B has compound P-key (i.e part of B's P-key is F-key to A).
b) Table B has some matching rows to table A.
c) In case keys are matched I insert some more rows to B successfully as
per requirement. in case of keys are unmatched Row are also inserted
successfully to B.
d) In case of matched keys: after successful row insertion prog fetch the
inserted row again. this confused me, the prog should fetch the next
row from temporary table which is the resultant of left join.
Note: The interesting thing is: suppose B has row like AFGC ..... and when the row is inserted with key ABCD then prog fetch ABCD again, but it doesn't happen in vice versa case.
Pl review and suggest the possible solution, thanks.
Bashir. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Bashir,
For FINAL TABLE example, Click Here.
I dont understand your other question properly, you may need to show an example of your query with sample data of table with desired result or your code, for anyone to answer.
Thanks,
Sushanth |
|
Back to top |
|
|
bashir ahmad
New User
Joined: 11 May 2013 Posts: 6 Location: canada
|
|
|
|
HI
What will happen in case of "DUPLICATE ROW" while using "FINAL TABLE" Technique?
Should I use EXISTANCE CHECK for the for the row to be inserted or updated before using "FINAL TABLE" Technique in which I select and update/insert at one place and can check the value before and after update. Thanks.
Best Regards
Bashir. |
|
Back to top |
|
|
|