I haven't seen this one, so I thought I'd throw it in:
* use ~ within the VAR instead of \ to code everything inline
VAR = \mysql --user username -e LOAD DATA infile
'/mnt/mount/FILE.TXT' REPLACE INTO TABLE database.updates FIELDS
TERMINATED BY ',' LINES TERMINATED BY '~n' (Emailaddress,
OKHow do I setup a
sh -c when what I want to pass has in it, single quotes, double quotes
and backslashes?
George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI Administrator
ggal...@wyanokegroup.com
ph:856.848.9005 Ext 220
The Wyanoke Group
...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, June 17, 2010 10:15 AM
To: U2 Users List
Subject: [U2] I've run out of quotes
OKHow do I setup a
sh -c when what I want to pass has in it, single quotes, double
quotes and backslashes?
George Gallen
Senior Programmer
Write a shell script to your current directory and execute it and
delete it
George Gallen wrote:
OKHow do I setup a
sh -c when what I want to pass has in it, single quotes, double quotes
and backslashes?
George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI
-
From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
boun...@listserver.u2ug.org] On Behalf Of Larry Hiscock
Sent: Thursday, June 17, 2010 1:22 PM
To: 'U2 Users List'
Subject: Re: [U2] I've run out of quotes
You can usually escape any given character passed to the shell
I wanted to avoid that route...but I don't think I can.
-Original Message-
From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-
boun...@listserver.u2ug.org] On Behalf Of Jeff Schasny
Sent: Thursday, June 17, 2010 1:28 PM
To: U2 Users List
Subject: Re: [U2] I've run out
...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, June 17, 2010 10:30 AM
To: U2 Users List
Subject: Re: [U2] I've run out of quotes
that doesn't help.
I'm passing is:
mysql --user username -e LOAD DATA infile '/mnt/mount/FILE.TXT' REPLACE
]
Sent: Thursday, June 17, 2010 10:43 AM
To: 'U2 Users List'
Subject: RE: [U2] I've run out of quotes
Use the QUOTE() function, thusly:
sh -c mysql --user username -e :QUOTE(LOAD DATA infile
'/mnt/mount/FILE.TXT' REPLACE INTO TABLE database.updates FIELDS TERMINATED
BY ',' LINES TERMINATED BY '\n
: [U2] I've run out of quotes
Use the QUOTE() function, thusly:
sh -c mysql --user username -e :QUOTE(LOAD DATA infile
'/mnt/mount/FILE.TXT' REPLACE INTO TABLE database.updates FIELDS TERMINATED
BY ',' LINES TERMINATED BY '\n' (Emailaddress, Reference) SET UpdateType =
'D', DateAdded
As an aside, most people here know that I prefer to do things
outside of the DBMS, but driven by the DBMS. So I do what you're
talking about all the time with mySQL, cURL, and many other
command-line tools.
Combine the great advice you've received so far to create the
best solution:
- Use
My experience is similar - I usually try to write out a shell script -
hopefully reusable.
...
Within basic code, I would preference equates over variables for quotes other
immutable delimiters. Not only more readable (like a variable) but also more
protection against fatfingeritus!
equ SQ to
On 6/17/2010 9:33 PM, Boydell, Stuart wrote:
My experience is similar - I usually try to write out a shell script -
hopefully reusable.
...
Within basic code, I would preference equates over variables for quotes other
immutable delimiters. Not only more readable (like a variable) but also
12 matches
Mail list logo