You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Scot P. Floess" <fl...@mindspring.com> on 2006/10/24 16:03:18 UTC
Re: error loading a mysqldump file
Can you elaborate more on the error?
Some years ago I was using the sql task and had a file full of SQL
statements... When I tried to use the sql task I was getting errors as
well. The solution, if memory serves, is that I had to use a \
character at the end of each line until SQL termination. So, if I had
something like:
create table foo
(
bar as int
);
I had to do this kind of thing:
create table foo \
( \
bar as int \
);
The problem (again if I can remember correctly) was that each line
(meaning new line/carriage return) was being interpreted as the "whole"
sql statement and submitted.
Hunter Peress wrote:
> using the sql task's src attribute i source a mysqldump file and it
> errors.
> mysql can source the file with no problems.
> but in ant I source it and theres a syntax error.
> There is no delimiter being set in the source.
> also if take individually two insert statement and source those it works.
> but i combine them and i get a syntax error.
>
> in the mysqldump the text fields are xml documents so they have almost
> every
> imagineable character.
>
> im using standard utf8 encoding. any ideas?
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: error loading a mysqldump file
Posted by Martin Gainty <mg...@hotmail.com>.
I know if I edit on windo and port to nix I will have <CR><LF> appended at end of each line
for small files
vi -b
will show you the extra CR and you can easily delete the CR (which show up as ^M) chars
for comprehensive treatment of entire files to unix run the dostounix utility
check out this link from the friendly folk from Santa Cruz for details
http://people.ucsc.edu/~chengyus/CE12L/DOSTOUNIX.htm
Martin --
This e-mail communication and any attachments may contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
contents
----- Original Message -----
From: "Scot P. Floess" <fl...@mindspring.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Tuesday, October 24, 2006 10:03 AM
Subject: Re: error loading a mysqldump file
> Can you elaborate more on the error?
>
> Some years ago I was using the sql task and had a file full of SQL
> statements... When I tried to use the sql task I was getting errors as
> well. The solution, if memory serves, is that I had to use a \
> character at the end of each line until SQL termination. So, if I had
> something like:
>
> create table foo
> (
> bar as int
> );
>
> I had to do this kind of thing:
>
> create table foo \
> ( \
> bar as int \
> );
>
> The problem (again if I can remember correctly) was that each line
> (meaning new line/carriage return) was being interpreted as the "whole"
> sql statement and submitted.
> Hunter Peress wrote:
>> using the sql task's src attribute i source a mysqldump file and it
>> errors.
>> mysql can source the file with no problems.
>> but in ant I source it and theres a syntax error.
>> There is no delimiter being set in the source.
>> also if take individually two insert statement and source those it works.
>> but i combine them and i get a syntax error.
>>
>> in the mysqldump the text fields are xml documents so they have almost
>> every
>> imagineable character.
>>
>> im using standard utf8 encoding. any ideas?
>>
>
> --
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: error loading a mysqldump file
Posted by "Scot P. Floess" <fl...@mindspring.com>.
More specifically if I had multiple SQL statements, I had to do this:
create table foo \
( \
bar as int \
);
create table alpha \
( \
beta as int \
);
Note that the \ is used until the ;
Scot P. Floess wrote:
> Can you elaborate more on the error?
>
> Some years ago I was using the sql task and had a file full of SQL
> statements... When I tried to use the sql task I was getting errors
> as well. The solution, if memory serves, is that I had to use a \
> character at the end of each line until SQL termination. So, if I had
> something like:
>
> create table foo
> (
> bar as int
> );
>
> I had to do this kind of thing:
>
> create table foo \
> ( \
> bar as int \
> );
>
> The problem (again if I can remember correctly) was that each line
> (meaning new line/carriage return) was being interpreted as the
> "whole" sql statement and submitted.
> Hunter Peress wrote:
>> using the sql task's src attribute i source a mysqldump file and it
>> errors.
>> mysql can source the file with no problems.
>> but in ant I source it and theres a syntax error.
>> There is no delimiter being set in the source.
>> also if take individually two insert statement and source those it
>> works.
>> but i combine them and i get a syntax error.
>>
>> in the mysqldump the text fields are xml documents so they have
>> almost every
>> imagineable character.
>>
>> im using standard utf8 encoding. any ideas?
>>
>
--
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org