Unix Technical Forum

Ascii 146

This is a discussion on Ascii 146 within the MySQL forums, part of the Database Server Software category; --> MySql newbie, sorry if the question is elementary. I'm trying to convert sql server database to MySql. Wrote a ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 03:49 PM
bruce
 
Posts: n/a
Default Ascii 146

MySql newbie, sorry if the question is elementary. I'm trying to
convert sql server database to MySql. Wrote a simple program to read
the MS SQL Server tables, and write to corresponding MySql tables.
Everything is going fine with one exception: the Insert statement
to write to the MySql table doesn't work when I encounter an Ascii
146.
Don't know much about character sets, but when creating the table,
I used the default character set, which is Latin1, I believe. I
thought that would handle non-Ascii characters.
Why does the insert statement fail? Thanks for any help given.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 03:49 PM
Captain Paralytic
 
Posts: n/a
Default Re: Ascii 146

On 29 Feb, 14:38, bruce <karc...@optonline.net> wrote:
> MySql newbie, sorry if the question is elementary. I'm trying to
> convert sql server database to MySql. Wrote a simple program to read
> the MS SQL Server tables, and write to corresponding MySql tables.
> Everything is going fine with one exception: the Insert statement
> to write to the MySql table doesn't work when I encounter an Ascii
> 146.
> Don't know much about character sets, but when creating the table,
> I used the default character set, which is Latin1, I believe. I
> thought that would handle non-Ascii characters.
> Why does the insert statement fail? Thanks for any help given.


"doesn't work" well that's helpful!

"Why does the insert statement fail?" You tell us. All you have said
is "doesn't work"!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 03:49 PM
bruce
 
Posts: n/a
Default Re: Ascii 146

On Feb 29, 10:05 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 29 Feb, 14:38, bruce <karc...@optonline.net> wrote:
>
> > MySql newbie, sorry if the question is elementary. I'm trying to
> > convert sql server database to MySql. Wrote a simple program to read
> > the MS SQL Server tables, and write to corresponding MySql tables.
> > Everything is going fine with one exception: the Insert statement
> > to write to the MySql table doesn't work when I encounter an Ascii
> > 146.
> > Don't know much about character sets, but when creating the table,
> > I used the default character set, which is Latin1, I believe. I
> > thought that would handle non-Ascii characters.
> > Why does the insert statement fail? Thanks for any help given.

>
> "doesn't work" well that's helpful!
>
> "Why does the insert statement fail?" You tell us. All you have said
> is "doesn't work"!


I get the old "invalid syntax in sql statement", and it gives the
piece of the sql statement immediately after the Ascii 146. I'm
guessing that the SQL parser for MySql thinks the Ascii 146 is a quote
mark, since it looks like one, and that is causing the failure, but
thought someone could shed more light for me. Apparently MS SQL
Server is does not have the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-01-2008, 03:49 PM
Captain Paralytic
 
Posts: n/a
Default Re: Ascii 146

On 29 Feb, 15:09, bruce <karc...@optonline.net> wrote:
> On Feb 29, 10:05 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>
>
> > On 29 Feb, 14:38, bruce <karc...@optonline.net> wrote:

>
> > > MySql newbie, sorry if the question is elementary. I'm trying to
> > > convert sql server database to MySql. Wrote a simple program to read
> > > the MS SQL Server tables, and write to corresponding MySql tables.
> > > Everything is going fine with one exception: the Insert statement
> > > to write to the MySql table doesn't work when I encounter an Ascii
> > > 146.
> > > Don't know much about character sets, but when creating the table,
> > > I used the default character set, which is Latin1, I believe. I
> > > thought that would handle non-Ascii characters.
> > > Why does the insert statement fail? Thanks for any help given.

>
> > "doesn't work" well that's helpful!

>
> > "Why does the insert statement fail?" You tell us. All you have said
> > is "doesn't work"!

>
> I get the old "invalid syntax in sql statement", and it gives the
> piece of the sql statement immediately after the Ascii 146. I'm
> guessing that the SQL parser for MySql thinks the Ascii 146 is a quote
> mark, since it looks like one, and that is causing the failure, but
> thought someone could shed more light for me. Apparently MS SQL
> Server is does not have the problem.


I think I'll go back to getting blood from stones. It is many times
easier than getting information out of you!

Post a sample statement and the full error message!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-01-2008, 03:49 PM
bruce
 
Posts: n/a
Default Re: Ascii 146

On Feb 29, 10:10 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 29 Feb, 15:09, bruce <karc...@optonline.net> wrote:
>
>
>
> > On Feb 29, 10:05 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:

>
> > > On 29 Feb, 14:38, bruce <karc...@optonline.net> wrote:

>
> > > > MySql newbie, sorry if the question is elementary. I'm trying to
> > > > convert sql server database to MySql. Wrote a simple program to read
> > > > the MS SQL Server tables, and write to corresponding MySql tables.
> > > > Everything is going fine with one exception: the Insert statement
> > > > to write to the MySql table doesn't work when I encounter an Ascii
> > > > 146.
> > > > Don't know much about character sets, but when creating the table,
> > > > I used the default character set, which is Latin1, I believe. I
> > > > thought that would handle non-Ascii characters.
> > > > Why does the insert statement fail? Thanks for any help given.

>
> > > "doesn't work" well that's helpful!

>
> > > "Why does the insert statement fail?" You tell us. All you have said
> > > is "doesn't work"!

>
> > I get the old "invalid syntax in sql statement", and it gives the
> > piece of the sql statement immediately after the Ascii 146. I'm
> > guessing that the SQL parser for MySql thinks the Ascii 146 is a quote
> > mark, since it looks like one, and that is causing the failure, but
> > thought someone could shed more light for me. Apparently MS SQL
> > Server is does not have the problem.

>
> I think I'll go back to getting blood from stones. It is many times
> easier than getting information out of you!
>
> Post a sample statement and the full error message!


Instead of getting blood from one, why don't you just crawl back under
it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-01-2008, 03:49 PM
Jerry Stuckle
 
Posts: n/a
Default Re: Ascii 146

bruce wrote:
> On Feb 29, 10:10 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>> On 29 Feb, 15:09, bruce <karc...@optonline.net> wrote:
>>
>>
>>
>>> On Feb 29, 10:05 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>>>> On 29 Feb, 14:38, bruce <karc...@optonline.net> wrote:
>>>>> MySql newbie, sorry if the question is elementary. I'm trying to
>>>>> convert sql server database to MySql. Wrote a simple program to read
>>>>> the MS SQL Server tables, and write to corresponding MySql tables.
>>>>> Everything is going fine with one exception: the Insert statement
>>>>> to write to the MySql table doesn't work when I encounter an Ascii
>>>>> 146.
>>>>> Don't know much about character sets, but when creating the table,
>>>>> I used the default character set, which is Latin1, I believe. I
>>>>> thought that would handle non-Ascii characters.
>>>>> Why does the insert statement fail? Thanks for any help given.
>>>> "doesn't work" well that's helpful!
>>>> "Why does the insert statement fail?" You tell us. All you have said
>>>> is "doesn't work"!
>>> I get the old "invalid syntax in sql statement", and it gives the
>>> piece of the sql statement immediately after the Ascii 146. I'm
>>> guessing that the SQL parser for MySql thinks the Ascii 146 is a quote
>>> mark, since it looks like one, and that is causing the failure, but
>>> thought someone could shed more light for me. Apparently MS SQL
>>> Server is does not have the problem.

>> I think I'll go back to getting blood from stones. It is many times
>> easier than getting information out of you!
>>
>> Post a sample statement and the full error message!

>
> Instead of getting blood from one, why don't you just crawl back under
> it?
>


You're the one asking for help.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-01-2008, 03:49 PM
Peter H. Coffin
 
Posts: n/a
Default Re: Ascii 146

On Fri, 29 Feb 2008 06:38:56 -0800 (PST), bruce wrote:
> MySql newbie, sorry if the question is elementary. I'm trying to
> convert sql server database to MySql. Wrote a simple program to read
> the MS SQL Server tables, and write to corresponding MySql tables.
> Everything is going fine with one exception: the Insert statement
> to write to the MySql table doesn't work when I encounter an Ascii
> 146.
> Don't know much about character sets, but when creating the table,
> I used the default character set, which is Latin1, I believe. I
> thought that would handle non-Ascii characters.
> Why does the insert statement fail? Thanks for any help given.


As a differnt question, why reinvent the wheel? There are several
conversion tools listed about half-way down on

http://dev.mysql.com/tech-resources/...microsoft.html

which may save you time and hassle. The rest of the page is a worthwhile
reaqd as well, since it will probably answer the next dozen or so
questions you'll have about how things work differently.

--
People who are willing to rely on the government to keep them safe are
pretty much standing on Darwin's mat, pounding on the door, screaming,
'Take me, take me!'
-- Carl Jacobs in the Monastery
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-01-2008, 03:49 PM
bruce
 
Posts: n/a
Default Re: Ascii 146

On Feb 29, 10:31 am, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On Fri, 29 Feb 2008 06:38:56 -0800 (PST), bruce wrote:
> > MySql newbie, sorry if the question is elementary. I'm trying to
> > convert sql server database to MySql. Wrote a simple program to read
> > the MS SQL Server tables, and write to corresponding MySql tables.
> > Everything is going fine with one exception: the Insert statement
> > to write to the MySql table doesn't work when I encounter an Ascii
> > 146.
> > Don't know much about character sets, but when creating the table,
> > I used the default character set, which is Latin1, I believe. I
> > thought that would handle non-Ascii characters.
> > Why does the insert statement fail? Thanks for any help given.

>
> As a differnt question, why reinvent the wheel? There are several
> conversion tools listed about half-way down on
>
> http://dev.mysql.com/tech-resources/...from-microsoft...
>
> which may save you time and hassle. The rest of the page is a worthwhile
> reaqd as well, since it will probably answer the next dozen or so
> questions you'll have about how things work differently.
>
> --
> People who are willing to rely on the government to keep them safe are
> pretty much standing on Darwin's mat, pounding on the door, screaming,
> 'Take me, take me!'
> -- Carl Jacobs in the Monastery


Thank for directing me there. It's a helpful document for me to have
in other areas of my migration, though it didn't shed light on this
exact question. I'll have to conclude that MySql, unlike SQL Server,
is treating an Ascii 146 like a single quote (which it looks like),
thereby giving me the SQL syntax error on the insert. I'll get around
it in the program I'm developing to do the migration. Thanks for your
help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-01-2008, 03:49 PM
Michael Austin
 
Posts: n/a
Default Re: Ascii 146

bruce wrote:
> On Feb 29, 10:31 am, "Peter H. Coffin" <hell...@ninehells.com> wrote:
>> On Fri, 29 Feb 2008 06:38:56 -0800 (PST), bruce wrote:
>>> MySql newbie, sorry if the question is elementary. I'm trying to
>>> convert sql server database to MySql. Wrote a simple program to read
>>> the MS SQL Server tables, and write to corresponding MySql tables.
>>> Everything is going fine with one exception: the Insert statement
>>> to write to the MySql table doesn't work when I encounter an Ascii
>>> 146.
>>> Don't know much about character sets, but when creating the table,
>>> I used the default character set, which is Latin1, I believe. I
>>> thought that would handle non-Ascii characters.
>>> Why does the insert statement fail? Thanks for any help given.

>> As a differnt question, why reinvent the wheel? There are several
>> conversion tools listed about half-way down on
>>
>> http://dev.mysql.com/tech-resources/...from-microsoft...
>>
>> which may save you time and hassle. The rest of the page is a worthwhile
>> reaqd as well, since it will probably answer the next dozen or so
>> questions you'll have about how things work differently.
>>
>> --
>> People who are willing to rely on the government to keep them safe are
>> pretty much standing on Darwin's mat, pounding on the door, screaming,
>> 'Take me, take me!'
>> -- Carl Jacobs in the Monastery

>
> Thank for directing me there. It's a helpful document for me to have
> in other areas of my migration, though it didn't shed light on this
> exact question. I'll have to conclude that MySql, unlike SQL Server,
> is treating an Ascii 146 like a single quote (which it looks like),
> thereby giving me the SQL syntax error on the insert. I'll get around
> it in the program I'm developing to do the migration. Thanks for your
> help.


from:
http://dev.mysql.com/doc/refman/5.0/...ng-syntax.html

Within a string, certain sequences have special meaning. Each of these
sequences begins with a backslash (“\”), known as the escape character.
MySQL recognizes the following escape sequences:
\0 An ASCII 0 (NUL) character.
\' A single quote (“'”) character.
\" A double quote (“"”) character.
\b A backspace character.
\n A newline (linefeed) character.
\r A carriage return character.
\t A tab character.
\Z ASCII 26 (Control-Z). See note following the table.
\\ A backslash (“\”) character.
\% A “%” character. See note following the table.
\_ A “_” character. See note following the table.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 03-01-2008, 03:49 PM
bruce
 
Posts: n/a
Default Re: Ascii 146

On Feb 29, 12:01 pm, Michael Austin <maus...@firstdbasource.com>
wrote:
> bruce wrote:
> > On Feb 29, 10:31 am, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> >> On Fri, 29 Feb 2008 06:38:56 -0800 (PST), bruce wrote:
> >>> MySql newbie, sorry if the question is elementary. I'm trying to
> >>> convert sql server database to MySql. Wrote a simple program to read
> >>> the MS SQL Server tables, and write to corresponding MySql tables.
> >>> Everything is going fine with one exception: the Insert statement
> >>> to write to the MySql table doesn't work when I encounter an Ascii
> >>> 146.
> >>> Don't know much about character sets, but when creating the table,
> >>> I used the default character set, which is Latin1, I believe. I
> >>> thought that would handle non-Ascii characters.
> >>> Why does the insert statement fail? Thanks for any help given.
> >> As a differnt question, why reinvent the wheel? There are several
> >> conversion tools listed about half-way down on

>
> >>http://dev.mysql.com/tech-resources/...from-microsoft...

>
> >> which may save you time and hassle. The rest of the page is a worthwhile
> >> reaqd as well, since it will probably answer the next dozen or so
> >> questions you'll have about how things work differently.

>
> >> --
> >> People who are willing to rely on the government to keep them safe are
> >> pretty much standing on Darwin's mat, pounding on the door, screaming,
> >> 'Take me, take me!'
> >> -- Carl Jacobs in the Monastery

>
> > Thank for directing me there. It's a helpful document for me to have
> > in other areas of my migration, though it didn't shed light on this
> > exact question. I'll have to conclude that MySql, unlike SQL Server,
> > is treating an Ascii 146 like a single quote (which it looks like),
> > thereby giving me the SQL syntax error on the insert. I'll get around
> > it in the program I'm developing to do the migration. Thanks for your
> > help.

>
> from:http://dev.mysql.com/doc/refman/5.0/...ng-syntax.html
>
> Within a string, certain sequences have special meaning. Each of these
> sequences begins with a backslash ("\"), known as the escape character.
> MySQL recognizes the following escape sequences:
> \0 An ASCII 0 (NUL) character.
> \' A single quote ("'") character.
> \" A double quote (""") character.
> \b A backspace character.
> \n A newline (linefeed) character.
> \r A carriage return character.
> \t A tab character.
> \Z ASCII 26 (Control-Z). See note following the table.
> \\ A backslash ("\") character.
> \% A "%" character. See note following the table.
> \_ A "_" character. See note following the table.



Thanks. If the following information is accurate (http://
bugs.mysql.com/bug.php?id=7756) then the Latin1 character set changes
the Ascii 146 to a single quote, therefore naturally messing up my
insert statement.
Thanks everyone for the further education in mysql, i wasn't aware
of all the places of documenatation that y'all have pointed out.
thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:06 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com