This blog has moved to http://ikhwanhayat.net

Friday, March 10, 2006

Lump Of Stupidity, Revisited

After the silly things done on my last entry [http://antikes.blogspot.com/2006/03/lump-of-stupidity.html], I went on learning a bit on how to use the DTS. Came out that I can customize the SQL to do transformation and export, so I did. Changed it like below. Since that I don't actually need the data to be accurate, I just filter out the nasty rows.

------ select first 100000 darn_col1, darn_col2, darn_col3 from darn_table where (darn_date_col1 is null or (darn_date_col1 >= DATE('1/1/1753') and (darn_date_col1 <= DATE('31/12/9999')))) and (darn_date_col2 is null or (darn_date_col2 >= DATE('1/1/1753') and (darn_date_col2 <= DATE('31/12/9999')))) ------

This is Informix's SQL. "FIRST" is the Informix way to do "TOP" (or "LIMIT"). DATE() is a function to turn strings to date type.

Okay, learned new things every day. "Learning is fun", like Barney the purple dinosaur said. Too bad Barney don't teach how to use the DTS.

0 Comments:

Post a Comment

<< Home