At 11:18 -0500 11/6/02, Vivian Wang wrote:
>This is my statement using python,
>db.query("load data infile '/data/winshare/experian/test' into table
>d_adds fields terminated by '' escaped by '\' lines terminated by
>Is python problem? not sure.
Looks like what's happening is that Python itself is processing escapes
before passing the query to MySQL, and MySQL itself will then process
escapes. You have to account for the extra level of escape processing.
db.query("load data infile '/data/winshare/experian/test' into table
d_adds fields terminated by '' escaped by '\\\\' lines terminated by
>At 10:01 AM 11/6/2002 -0600, Paul DuBois wrote:
>>At 10:03 -0500 11/6/02, Vivian Wang wrote:
>>>I did my testing.
>>>If I use ESCAPED BY '\\', I got
>>>1064, "You have an error in your SQL syntax near ''' at line 2"
>>>Using ESCAPED BY '\', then no error and result is fine.
>>>If the data contains "\", then database will automatically takes
>>>"\" away and shift 1 byte left.
>>>My data will mass up. That is why I still need "\"
>>>I posted my syntax before, but nobody helped me to figure out.
>>>So this time I did my test again and found out only need one "\"
>>>for ESCAPED BY.
>>I think there's something else wrong with the statement. You do need
>>to use two backslashes to specify an escape character of a single backslash.
>>Can we see the entire LOAD DATA statement exactly as you specified it
>>>At 10:43 PM 11/5/2002 -0600, you wrote:
>>>>At 14:38 -0500 11/5/02, Vivian Wang wrote:
>>>>>The syntac ESCAPED BY of load data infile is wrong in
>>>>>the [ESCAPED by '\\']
>>>>>[ESCAPED BY '\']
>>>>Why do you say that?