RE: MySQL text
am 14.09.2006 23:56:18 von Adrian Greeman
Thanks for the advice
You are right the Newdate does not belong there
I modified your version to lose that and got this:
SQL query:
INSERT INTO chng( IssueNo, Head, Chardate, auth_id, PaperName )
VALUES ( 1282, `Pleading with them is no answer to the turmoil. Society and
the change is a to yet more - the only way out is entry limits. Let the
""green"" be an impotent endpiont raod dreamscape.` , `04 /12 /2005` , 15, 1
) ;
MySQL said: Documentation
#1054 - Unknown column 'Pleading with them is no answer to the turmoil.
Society and the ' in 'field list'
And then I tried this revised version of mine:
SQL query:
INSERT INTO chng( `IssueNo` , `Head` , `Chardate` , `auth_id` , `PaperName`
)
VALUES ( 1278 | "Pleading with them is no answer to the turmoil. Society and
the change is a to yet more - the only way out is entry limits. Let the
""green"" be an impotent endpiont raod dreamscape.." |06 /10 /2005 |15 |1 )
;
MySQL said: Documentation
#1136 - Column count doesn't match value count at row 1
I have a feeling it is automatically setting the first field of the first
column as zero which is why I get a zero when I do it with LOAD DATA and it
won't go at all with INSERT. Could that be happening?
Regards
Adrian
-----Original Message-----
From: John Theroux [mailto:john@northerninnovators.com]
Sent: 14 September 2006 17:38
To: adriangreeman@pixandwords.freeserve.co.uk
Subject: MySQL text
Adrian;
Take a look at the following and see if it can help:
Your Way:
INSERT INTO chng( IssueNo, Head, Chardate, NewDate, auth_id, PaperName )
VALUES ( 1282, "Pleading with them is no answer to the turmoil. Society and
the change is a to yet more - the only way out is entry limits. Let the
""green"" be an impotent endpiont raod dreamscape.", 04 /12 /2005, 15, 1 ) ;
My Way:
INSERT INTO chng( IssueNo, Head, Chardate, NewDate, auth_id, PaperName )
VALUES ( 1282, `Pleading with them is no answer to the turmoil. Society and
the change is a to yet more - the only way out is entry limits. Let the
""green"" be an impotent endpiont raod dreamscape.`,`04 /12 /2005`,, 15, 1 )
;
let me know if this helps.
john
ps. noted your query only supplies 5 values but defines 6 fields (just a
typo ?)
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: MySQL text
am 15.09.2006 00:46:54 von Randy Clamons
Hey, I may be way off the mark here, but it seems it's the "" that's
throwing this off. The back ticks are used to identify tables, columns,
etc. They won't work to enclosed a string.
I don't know if there is any way around this, except to replace the ""
with \". I am certain this will work. Or you could enclose the column in
single quotes ('), but then you will have the same problem when the text
contains one or more ('). I am also certain that this will happen.
Have you tried using ESCAPED BY '"' in the FIELDS clause? I can't really
say what that will do, but it might work (according to the docs).
I suggest you look at your sample data. I'll bet you find the failed
rows all contain "" somewhere within them.
Otherwise, it looks like the inserted data would have 7 columns of data
to put into 5 columns. The text column itself has 3 pair of ", that
probably appears to be 3 columns of data.
Sorry, I'm not using mySql 5.xxx, so this may be no help at all.
Randy Clamons
Systems Programming
randy@novaspace.com
adrian GREEMAN wrote:
> Thanks for the advice
>
> You are right the Newdate does not belong there
>
> I modified your version to lose that and got this:
>
> SQL query:
> INSERT INTO chng( IssueNo, Head, Chardate, auth_id, PaperName )
> VALUES ( 1282, `Pleading with them is no answer to the turmoil. Society and
> the change is a to yet more - the only way out is entry limits. Let the
> ""green"" be an impotent endpiont raod dreamscape.` , `04 /12 /2005` , 15, 1
> ) ;
> MySQL said: Documentation
> #1054 - Unknown column 'Pleading with them is no answer to the turmoil.
> Society and the ' in 'field list'
>
>
> And then I tried this revised version of mine:
>
> SQL query:
> INSERT INTO chng( `IssueNo` , `Head` , `Chardate` , `auth_id` , `PaperName`
> )
> VALUES ( 1278 | "Pleading with them is no answer to the turmoil. Society and
> the change is a to yet more - the only way out is entry limits. Let the
> ""green"" be an impotent endpiont raod dreamscape.." |06 /10 /2005 |15 |1 )
> ;
>
> MySQL said: Documentation
> #1136 - Column count doesn't match value count at row 1
>
> I have a feeling it is automatically setting the first field of the first
> column as zero which is why I get a zero when I do it with LOAD DATA and it
> won't go at all with INSERT. Could that be happening?
>
> Regards
> Adrian
>
>
> -----Original Message-----
> From: John Theroux [mailto:john@northerninnovators.com]
> Sent: 14 September 2006 17:38
> To: adriangreeman@pixandwords.freeserve.co.uk
> Subject: MySQL text
>
>
> Adrian;
>
> Take a look at the following and see if it can help:
>
> Your Way:
>
> INSERT INTO chng( IssueNo, Head, Chardate, NewDate, auth_id, PaperName )
> VALUES ( 1282, "Pleading with them is no answer to the turmoil. Society and
> the change is a to yet more - the only way out is entry limits. Let the
> ""green"" be an impotent endpiont raod dreamscape.", 04 /12 /2005, 15, 1 ) ;
>
> My Way:
>
> INSERT INTO chng( IssueNo, Head, Chardate, NewDate, auth_id, PaperName )
> VALUES ( 1282, `Pleading with them is no answer to the turmoil. Society and
> the change is a to yet more - the only way out is entry limits. Let the
> ""green"" be an impotent endpiont raod dreamscape.`,`04 /12 /2005`,, 15, 1 )
> ;
>
> let me know if this helps.
>
> john
>
> ps. noted your query only supplies 5 values but defines 6 fields (just a
> typo ?)
>
>
>
>
>
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org