I am executing a stored proc and sending the results in a log file. I then want to grab one result from the output parameters (bolded below, 2) so that I can store it in a variable which will then be called in another script. There are more details that get printed in the beginning of the log file, but what you see below gets printed at the end of the log file. This matters mentioning it because the line number where this value will show up in will not always be the same, due to possible errors that may occur in the program. I know that there is a grep -n command which tells you what line that value is, but seeing as this will be an automated script, I won't be able to see what line it is everytime the script runs. Any ideas/comments/suggestions?
Quote:
.............
db2 => CALL STORED_PROC('1-2',?,?,?,?)
Value of output parameters
--------------------------
Parameter Name : PROC_MSG
Parameter Value : STORED_PROC completed successfully
Parameter Name : BATCHES_UPDATED
Parameter Value : 2
Parameter Name : START_TS
Parameter Value : 2008-08-19-12.42.05.192288
Parameter Name : END_TS
Parameter Value : 2008-08-19-12.42.05.193165
Return Status = 0
db2 => disconnect current
DB20000I The SQL DISCONNECT command completed successfully.
db2 => quit
DB20000I The QUIT command completed successfully.
|
Thanks!