List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:April 4 1999 12:39am
Subject:Redefining default delimeters
View as plain text  
>>>>> "Frank" == Frank Piwarski <fpiwarsk@stripped> writes:

Frank> This syntax is ofcourse used with LOAD DATA INFILE
-> fields terminated by ','
-> enclosed by '"'
-> lines terminated by '/r'

Frank> but can i do a similiar thing in an UPDATE statement to re-define field
Frank> temination along this line

Frank> fields-terminated-by '^^'

Frank> the reason being that i have a file that reads like this

Frank> UPDATE _remembrance set client = '_429UJ9JF',
Frank> SetTitle = 'Photo Gallery',
Frank> CountryCode = 'us',
Frank> Password = 'passMEthePossum',
Frank> Visible = 'true',
Frank> Expires = '12/1/2000',
Frank> AdGroup = 'zx3',
Frank> SetCode = '000',
Frank> Language = 'us',
Frank> template = 'cloud.jpg',
Frank> regnum = '_10350005399',
Frank> regco = 'Honest Johns Funeral Home',
Frank> regaddress1 = '1712 N. Harold's Ln.',
Frank> regaddress2 = 'State Rd. 46',

Frank> and i would like to use syntax like what follows. I am happy to
Frank> recompile to support this if that is possible.

Frank> UPDATE _remembrance set client = ^^_429UJ9JF^^
Frank> SetTitle = ^^Photo Gallery^^
Frank> CountryCode = ^^us^^
Frank> Password = ^^pass^^
Frank> Visible = ^^true^^
Frank> Expires = ^^12/1/2000^^
Frank> AdGroup = ^^zx3^^
Frank> SetCode = ^^000^^
Frank> Language = ^^us^^
Frank> template = ^^cloud.jpg^^
Frank> regnum = ^^_10350005399^^
Frank> regco = ^^Honest Johns Funeral Home^^
Frank> regaddress1 = ^^1712 N. Harold's Ln.^^
Frank> regaddress2 = ^^State Rd. 46^^,

Hi!

May I ask you why ?  If you have problems with quoting, you should
look at the appropriate 'quote' or 'escape' functions in the API you
are using!

The major problem with fixing this is that you have to patch both the
'mysql' program to find 'end of strings', and sql_lex.cc to understand 
that a string can start with ^^.  Neither patch is completely trivial.

Regards,
Monty
Thread
Redefining default delimetersFrank Piwarski4 Apr
  • Redefining default delimetersMichael Widenius4 Apr
  • Re: Redefining default delimetersFrank Piwarski4 Apr
  • Re: Redefining default delimetersFrank Piwarski4 Apr