What is your logic for table2? It looks like wether the table2 update works or no it always passes back a success_flag ='Y'.