Hello,

If my load data statment is such:

load data infile 'myfile.csv'
into table mytab1
fields delimited by ','
lines terminated by '\n'
(my_code,my_amt);

Where do I do the replace?  How do I translate the N/A into \N on the fly?

Thank you.


---- Ananda Kumar <[EMAIL PROTECTED]> wrote: 
> replace N/A with \N, this will get inserted as NULL
> 
> On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > I have following table :
> >
> > mytab1
> > ------
> > my_code varchar(3)
> > my_amt  float(10,2)
> >
> >
> > I also have the following file my.csv  to load:
> >
> > ABC,23,41
> > DEF,234,99
> > GHI,N/A
> > JKL,99.50
> >
> > My 'load data infile' bombs loading the 3rd row.  Obviously,
> > it not the correct data type.  On my load data script I would
> > like to say 'if N/A then load a null'.  How can I do this in
> > mysql?  Can I use the SET command somehow?
> >
> > I'm new to mysql.  Thanks.
> >
> > Mike
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to