/* Copyright © Oracle Corporation 1995. All Rights Reserved. */ /**************************************************************************** * This routine is called from the main program to add an employee to the * East database. It expects two paramters the distributed context structure * and the employee record structure. * * *****************************************************************************/ #include #include #include #include #include ctype struct context_struct { long version; long type; long length; long distributed_tid[4]; long end; }; struct employ_struct { char emp_id[6]; char emp_last_name[15]; char emp_first_name[11]; char emp_middle_initial[2]; char emp_address1[26]; char emp_city[21]; char emp_state[3]; char emp_zip[6]; char emp_sex[2]; char emp_birth[8]; }; long sqlcode; int status; short iosb[4]; void sql$dist_trans_error (struct context_struct *context); void start_east(); void insert_east(); rdb_add_east(struct context_struct *context, struct employ_struct *employee) { struct context_struct local_context; struct employ_struct local_employee; local_context = *context; local_employee = *employee; printf("\nStart Transaction East \n "); start_east(&sqlcode, &local_context); if (sqlcode != 0) sql$dist_trans_error(&local_context); printf("\nInserting Record East \n "); insert_east(&sqlcode,&local_employee.emp_id, &local_employee.emp_last_name, &local_employee.emp_first_name, &local_employee.emp_middle_initial, &local_employee.emp_address1, &local_employee.emp_city, &local_employee.emp_state, &local_employee.emp_zip, &local_employee.emp_sex, &local_employee.emp_birth, &local_context); if (sqlcode != 0) sql$dist_trans_error(&local_context); return; }