######################################################################
# Action routine to OPEN the cursor for the SELECT statement and FETCH
# the first row of data into the ESL host variables.
######################################################################
action GetFirstStaffRow is
# Call DB/Assist generated action routine to open the cursor for the
# Select Statement.
action OPEN_SelectStaffUpdate
# If EDB2Error_BV is false the call DB/Assist then generated action
# routine to fetch the cursor into the ESL host variables.
if not (EDB2Error_BV) then
action FETCH_SelectStaffUpdate
end if
# If the EDB2Error_BV is true call an action routine to display the
# error to the user. Action DisplayError can be any user written
# action routine which can display the appropriate error information
# to the user.
if (EDB2Error_BV) then
action DisplayError
end if
######################################################################
# This response will be triggered in response to EDB2_STARTED
######################################################################
response to stimulus DB EDB2_STARTED
# Execute the GetFirtStaffRow action routine
action GetFirstStaffRow
# Reset the UpdateStaff_DB to reflect the new values
action SetupUpdateStaff_DB
######################################################################
# This response will be triggered when the user clicks on the
# Next_PB in the UpdateStaff_DB.
######################################################################
response to Next_PB in UpdateStaff_DB
# Exececute the DB/Assist generated action routine to fetch the next
# row of data.
action FETCH_SelectStaffUpdate
# If the error condition END_OF_DATA has been met display a message
# about hitting the last row of data.
if (Esqlca.Sqlcode = END_OF_DATA) then
if (ReplyToMessage("End of STAFF List",
"Do you want to start over from the beginning?",
MessageYesNo,2,MessageWarning) = "yes")then
# If the user chooses to "start over from the beginning" then close
# the cursor and execute the GetFirtStaffRow action routine
action CLOSE_SelectStaffUpdate
if not (EDB2Error_BV) then
action GetFirstStaffRow
end if
end if
end if
# If the EDB2Error_BV is false call the user written action routine
# SetUpdateStaff_DB to reset the List_TBL to reflect the new values in
# the STAFF table.
if not(EDB2Error_BV) then
action SetupUpdateStaff_DB
# If the EDB2Error_BV is true call an action routine to display the
# error to the user. Action DisplayError can be any user written
# action routine which can display the appropriate error information
# to the user.
else
action DisplayError
end if