collect the data by sql from shell