C Copyright © Oracle Corporation 1995. All Rights Reserved. SUBROUTINE call_other(data_base_key,trans1) C------------------------------------------------------ C This subroutine is passed the dbkey and transaction C handle from the DELETE_RECORD subroutine. C With this information, it can find and display the C employee record associated with an employee_id specified C in DELETE_RECORD and then return program control to the C DELETE_RECORD subroutine. C-------------------------------------------------------- IMPLICIT NONE INTEGER*4 birthday(2),SYS$ASCTIM,trans1 CHARACTER employee_id*5,last_name*14,first_name*10,middle_initial CHARACTER city*20,state*2,postal_code*5,ascii_date*23 CHARACTER*8 data_base_key CHARACTER*25 address_data_1,address_data_2 C----------------------------------------------------------- C Because the database was invoked in the main program C with GLOBAL attributes, refer to it here as EXTERNAL. C----------------------------------------------------------- &RDB& DATABASE EXTERNAL pers = FILENAME 'MF_PERSONNEL' &RDB& DBKEY SCOPE IS FINISH C------------------------------------------------------------- C The transaction was started in the DELETE_RECORD subroutine, C so there is no need to start a transaction here. Use the C transaction handle to identify this request with the C transaction started in DELETE_RECORD. Use the dbkey found C in DELETE_RECORD to locate the correct employee record. C-------------------------------------------------------------- &RDB& FOR (TRANSACTION_HANDLE trans1) E IN EMPLOYEES WITH &RDB& E.RDB$DB_KEY = data_base_key &RDB& GET &RDB& employee_id = E.EMPLOYEE_ID; &RDB& last_name = E.LAST_NAME; &RDB& first_name = E.FIRST_NAME; &RDB& middle_initial = E.MIDDLE_INITIAL; &RDB& address_data_1 = E.ADDRESS_DATA_1; &RDB& address_data_2 = E.ADDRESS_DATA_2; &RDB& city = E.CITY; &RDB& state = E.STATE; &RDB& postal_code = E.POSTAL_CODE; &RDB& birthday = E.BIRTHDAY; &RDB& END_GET &RDB& END_FOR C------------------------------------------------- C Display the EMPLOYEES record. Use SYS$ASCTIM C to convert the date stored in the database in C binary to ASCII format. C------------------------------------------------- CALL SYS$ASCTIM (, ascii_date, birthday, ) TYPE 12000, employee_id, last_name, first_name, 1 middle_initial, address_data_1, 1 address_data_2, city, state, 1 postal_code, ascii_date 12000 FORMAT (// ' Employee_id: ',A/ 1 ' Last name: ',A/ 1 ' First name: ',A/ 1 ' Middle initial: ',A/ 1 ' Address: ',A,' ',A/ 1 ' City: ',A/ 1 ' State: ',A/ 1 ' Postal code: ',A/ 1 ' Birthday: ',A//) C--------------------------------------------------------- C Return program control to the DELETE_RECORD subroutine. C--------------------------------------------------------- RETURN END