/* Copyright © Oracle Corporation 1995. All Rights Reserved. */ #include /* This function is passed the dbkey and transaction handle */ /* from the DELETE_RECORD function within program C_SAMPLE.RC. */ /* With this information, it can find and display the employee record */ /* associated with an employee_id specified in DELETE_RECORD and then */ /* return program control to the DELETE_RECORD function. */ /* Because the database was invoked in the main program with */ /* GLOBAL attributes, refer to it here as EXTERNAL. */ DATABASE PERS = [EXTERNAL] FILENAME "MF_PERSONNEL"; typedef BASED ON EMPLOYEES.RDB$DB_KEY db_key_type; globalref int trans_1; call_other (dbkey, req_1) db_key_type dbkey; int req_1; { /* The transaction was started in the DELETE_RECORD function, */ /* so there is no need to start a transaction here. Use the */ /* transaction handle to identify this request with the */ /* transaction started in DELETE_RECORD. Use the dbkey found */ /* in the DELETE_RECORD function to locate the correct employee */ /* record. */ FOR (TRANSACTION_HANDLE trans_1, REQUEST_HANDLE req_1) E IN EMPLOYEES WITH E.RDB$DB_KEY = dbkey /* Display the EMPLOYEES record. */ printf (" \n"); printf ("Last Name: %s\n", E.LAST_NAME); printf ("First Name: %s\n", E.FIRST_NAME); printf ("Street: %s\n", E.ADDRESS_DATA_1); printf ("Apartment: %s\n", E.ADDRESS_DATA_2); printf ("City: %s\n", E.CITY); printf ("State: %s\n", E.STATE); printf ("Zip Code: %s\n", E.POSTAL_CODE); printf ("Sex: %s\n\n", E.SEX); END_FOR; } /* Return program control to the DELETE_RECORD function */