SUB CALL_OTHER(STRING db_key, LONG trans_1) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! This subroutine is passed the dbkey and transaction handle ! ! from the DELETE_RECORD subroutine in the program B_SAMPLE.RBA. ! ! With this information, the program can find and display the ! ! the employee record associated with an employee_id specified in ! ! DELETE_RECORD and then return program control to the DELETE_RECORD ! ! subroutine. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! RECORD EMPLOYEE STRING employee_id = 5 STRING last_name = 14 STRING first_name = 10 STRING middle_initial = 1 STRING address_data_1 = 25 STRING address_data_2 = 25 STRING city = 20 STRING state = 2 STRING postal_code = 5 STRING sex = 1 GROUP birthday STRING string_value = 8 END GROUP STRING status_code = 1 END RECORD MAP (RECORDS) employee employees ! Because the database was invoked in the main program ! with GLOBAL attributes, refer to it here as EXTERNAL. &RDB& DATABASE EXTERNAL pers = FILENAME "MF_PERSONNEL" DBKEY SCOPE IS FINISH ! The transaction was started in the DELETE_RECORD subroutine, ! so there is no need to start a transaction here. Use the ! transaction handle to identify the request with the transaction ! started in the DELETE_RECORD subroutine. Use the dbkey found in ! DELETE_RECORD to locate the correct employee record. &RDB& FOR (TRANSACTION_HANDLE trans_1) e IN employees WITH &RDB& E.RDB$DB_KEY = db_key &RDB& GET &RDB& employees::employee_id = E.EMPLOYEE_ID; &RDB& employees::last_name = E.LAST_NAME; &RDB& employees::first_name = E.FIRST_NAME; &RDB& employees::middle_initial = E.MIDDLE_INITIAL; &RDB& employees::address_data_1 = E.ADDRESS_DATA_1; &RDB& employees::address_data_2 = E.ADDRESS_DATA_2; &RDB& employees::city = E.CITY; &RDB& employees::state = E.STATE; &RDB& employees::postal_code = E.POSTAL_CODE; &RDB& employees::birthday::string_value = E.BIRTHDAY &RDB& END_GET ! Display the EMPLOYEES record. PRINT PRINT "Employee id: ", employees::employee_id PRINT "Last name: ", employees::last_name PRINT "First name:", employees::first_name PRINT "Middle initial: ", employees::middle_initial PRINT "Address: ", employees::address_data_1, employees::address_data_2 PRINT "City:", employees::city PRINT "State:", employees::state PRINT "Postal code: ", employees::postal_code &RDB& END_FOR END SUB