Outputting SQL statement for debugging