I have to write query in select statement and output result should be in text file with particular filename.