MySQL Forums :: Other Migration :: sql-mode="strict_all_tables" has no effect when using Load Data Infile


Advanced Search

sql-mode="strict_all_tables" has no effect when using Load Data Infile
Posted by: L Peal ()
Date: July 27, 2010 03:00PM

I'm using Load Data Infile and need to conditionally exclude an entire row of data if a certain column contains 0. I cannot use partitioning mentioned at the bottom of this link http://dev.mysql.md/doc/refman/5.4/en/load-data.html because valid data goes from .01 to 99999999.99.
Load Data Infile does not seem to have a feature to conditionally exclude an entire row (yet continue with the rest of the load).

So I hacked up a solution I thought might work:
IF(@pdsn_fwd_link_byte_cnt RLIKE '^[0-0.00\\.\\-]+$', 'x', @pdsn_fwd_link_byte_cnt),

Esentially trying to insert a non-numeric character if a '0' was encountered. Thought this would cause an error intentionally and cause the row to be rejected.

I found a link someone posted similar to what I'm trying to do: http://bugs.mysql.com/bug.php?id=29188
So, if this is not a bug, then is it a feature?? Any ideas on how to accomplish what should be a trivial task are greatly appreciated.

Thanks!

Options: ReplyQuote


Subject Views Written By Posted
sql-mode="strict_all_tables" has no effect when using Load Data Infile 4621 L Peal 07/27/2010 03:00PM
Re: sql-mode="strict_all_tables" has no effect when using Load Data Infile 2356 devdewboy devdewboy 07/27/2010 05:17PM
Re: sql-mode="strict_all_tables" has no effect when using Load Data Infile 1650 L Peal 07/28/2010 12:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.