Problem source: http://bbs.csdn.net/topics/370240857
Below is a selection from a database table,
TB1:
Based on this data, you need to generate
text files of the specified format and with the following names (yyyyMMddHH) by
the hour.
2011101106.txt
1|2011-10-11 6:24:21|aaa
2|2011-10-11 6:30:45|dddd
2011101107.txt
3|2011/10/11 7:10:12|dsf
4|2011/10/11 7:50:38|dffew
5|2011/10/11 7:59:59|dfae
2011101108.txt
6|2011/10/11 8:00:00|edfae
A1: Use a SQL to create a database cursor
sorted by CreateTime. db represents the connection to a database.
A2-B2: Group data by CreateTime (yyyyMMddHH),
and fetch data by loop, one group each time, to export, through B2, to text files
named after the create time. And specifiy format for the text data at the same
time.
No comments:
Post a Comment