add function: record original SQL query result into txt file