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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| |||
| 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"! |
| |||
| 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. |
| |||
| 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! |
| |||
| 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? |
| |||
| 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 ================== |
| |||
| 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 |
| |||
| 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. |
| |||
| 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. |
| ||||
| 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. |