Board index » delphi » "#" character as part of MySQL field

"#" character as part of MySQL field

Hello,

I tried to insert a # as part of a field and got an error from the server
saying that I had an error in my SQL statement at line 1 "F:\\BL'. The error
number is (8000FFFF) and the value is supposed to be "F:\\BL#". I understand
that MySQL is interpretting that as a comment identifier.

However, when I run the same query through the ODBC (via database explorer)
driver it works well enough.

The statement is:

"INSERT INTO Xrefs Values ('base.dwg', 'F:\\accel\\rad\\', '1.dwg',
'F:\\else\\bl#\\');"

How can I get MySQL (via ZeosDBO in Delphi 5) to accept the # sign? Add
extra quotes or
a backslash before the character?  Use double quotes?  Some other method?

This is the ONLY outstanding issue in my application (well, so far, we know
how that goes right?).  Any ideas appreciated. Thanks.

Regards,
Rob

 

Re:"#" character as part of MySQL field


In SQL Server we put [] around the columnd name
Perhaps MYSQL has simular code

Quote
"Robby Tanner" <rtan...@cls.usask.ca> wrote in message

news:3e4e99c2$1@newsgroups.borland.com...
Quote
> Hello,

> I tried to insert a # as part of a field and got an error from the server
> saying that I had an error in my SQL statement at line 1 "F:\\BL'. The
error
> number is (8000FFFF) and the value is supposed to be "F:\\BL#". I
understand
> that MySQL is interpretting that as a comment identifier.

> However, when I run the same query through the ODBC (via database
explorer)
> driver it works well enough.

> The statement is:

> "INSERT INTO Xrefs Values ('base.dwg', 'F:\\accel\\rad\\', '1.dwg',
> 'F:\\else\\bl#\\');"

> How can I get MySQL (via ZeosDBO in Delphi 5) to accept the # sign? Add
> extra quotes or
> a backslash before the character?  Use double quotes?  Some other method?

> This is the ONLY outstanding issue in my application (well, so far, we
know
> how that goes right?).  Any ideas appreciated. Thanks.

> Regards,
> Rob

Re:"#" character as part of MySQL field


It isn't the column name that's causing the problem, in fact the column
names aren't even specified.  The trouble is the interpretation of the # as
a comment rather than part of the string I'm passing in as part of a value
in the INSERT statement.

Thanks for the attempt,
Rob

Quote
"Vanessa Amaral" <Va...@2beCreative.com> wrote in message

news:3e4ef9ad$1@newsgroups.borland.com...
Quote
> In SQL Server we put [] around the columnd name
> Perhaps MYSQL has simular code

> "Robby Tanner" <rtan...@cls.usask.ca> wrote in message
> news:3e4e99c2$1@newsgroups.borland.com...
> > Hello,

> > I tried to insert a # as part of a field and got an error from the
server
> > saying that I had an error in my SQL statement at line 1 "F:\\BL'. The
> error
> > number is (8000FFFF) and the value is supposed to be "F:\\BL#". I
> understand
> > that MySQL is interpretting that as a comment identifier.

> > However, when I run the same query through the ODBC (via database
> explorer)
> > driver it works well enough.

> > The statement is:

> > "INSERT INTO Xrefs Values ('base.dwg', 'F:\\accel\\rad\\', '1.dwg',
> > 'F:\\else\\bl#\\');"

> > How can I get MySQL (via ZeosDBO in Delphi 5) to accept the # sign? Add
> > extra quotes or
> > a backslash before the character?  Use double quotes?  Some other
method?

> > This is the ONLY outstanding issue in my application (well, so far, we
> know
> > how that goes right?).  Any ideas appreciated. Thanks.

> > Regards,
> > Rob

Re:"#" character as part of MySQL field


Quote
Robby Tanner wrote:
> It isn't the column name that's causing the problem, in fact the
> column names aren't even specified.  The trouble is the
> interpretation of the # as a comment rather than part of the string
> I'm passing in as part of a value in the INSERT statement.

This is definitelly a bug. Contact MySQL guys

--
Bojidar Alexanrov
Kodar Ltd.
http://www.Kodar.net

Re:"#" character as part of MySQL field


A bug in MySQL or ZeosDBO?

Quote
"Bojidar Alexandrov" <b...@kodar.net> wrote in message

news:3e508b0a@newsgroups.borland.com...
Quote
> Robby Tanner wrote:
> > It isn't the column name that's causing the problem, in fact the
> > column names aren't even specified.  The trouble is the
> > interpretation of the # as a comment rather than part of the string
> > I'm passing in as part of a value in the INSERT statement.

> This is definitelly a bug. Contact MySQL guys

> --
> Bojidar Alexanrov
> Kodar Ltd.
> http://www.Kodar.net

Re:"#" character as part of MySQL field


Actually, I don't think it's with MySQL.  I can run the query from their
Interactive SQL window and it works through the ODBC as well.

Must be something to do with ZeosDBO or libmysql.dll.

Rob

Quote
"Bojidar Alexandrov" <b...@kodar.net> wrote in message

news:3e508b0a@newsgroups.borland.com...
Quote
> Robby Tanner wrote:
> > It isn't the column name that's causing the problem, in fact the
> > column names aren't even specified.  The trouble is the
> > interpretation of the # as a comment rather than part of the string
> > I'm passing in as part of a value in the INSERT statement.

> This is definitelly a bug. Contact MySQL guys

> --
> Bojidar Alexanrov
> Kodar Ltd.
> http://www.Kodar.net

Other Threads