[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conditional default value


At 14:00 -0900 2/15/03, Tim Johnson wrote:
Hello All:
    (using MYSQL Ver 11.15 Distrib 3.23.41
     for redhat-linux-gnu (i386) (RH 7.2))

I am importing text data (but in a numeric format).
  The customers wants 'N/A' in an empty field.
Additionally:
  The customer wishes that if a field = '9999'
    the default value of 'N/A' be substituted.
Is this possible to do in MySQL?

Sure, but not with LOAD DATA.  You can either preprocess the data file
beforehand, or do this after import:

UPDATE TABLE t SET col = 'N/A' IF col = '' OR col = '9999';

  Documentation?

Regards
--
Tim Johnson <suppressed>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <suppressed>
To unsubscribe, e-mail <suppressed>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.