Method to receive last executed sql query