MIDRANGE dot COM Mailing List Archive



MIDRANGE-L » January 2013

Update information on SQL



Hi there,
 
I've an SQLSRC statement embedded in RUNSQLSTM. My spool file tells me how many rows have been updated.
But, does anyone know how to find the updated rows information without actually going back to the database file to query the records updated.
 
UPDATE Afile A
SET A.Netamt = (SELECT replace(B.net_amount , ',' , '')
FROM Bfile B
WHERE A.date1 = B.date1), A.source ='1'
WHERE EXISTS
(SELECT B.net_amount
FROM Bfile B
WHERE A.date1 = B.date1)
 
This updates me 120 rows, I would like to see which rows it updates Netamt & source to 1 after running SQL.
I could SQL
Select A.Netamt, A.source from Afile A, Bfile B
  where A.date1 =B.date1
 
Thank you!
 
p.s: can anyone recommend best SQL/400 book, sorry if this question does nt relate to this forum.





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2013 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact