MySQL Forums
Forum List  »  General

the '?' character can't be escaped?
Posted by: Ed Zehoo
Date: October 12, 2004 05:47AM

Hi,
I'm having a problem with mySQL :

INSERT INTO mytable(myfield1,myfield2) VALUES ('?abcdef','testing')

When I run the SQL query above using VB6 + ADO, what happens is I get an error saying that it was expecting a parameter.
I know that in mySQL you can do parameterized queries by using the '?' character in place of the value. However, in my example above, it is quite obvious that what I'm trying to insert is not a parameterized item, but a string called '?abcdef' ...

mySQL somehow seems to ignore this, and it still doesnt work even with the escape character in front of the '?' . However, if the '?' was anywhere else in the string (not the first character), then it works...

for example : this works ->
INSERT INTO mytable(myfield1,myfield2) VALUES ('abc?def','testing')

So is this a mySQL bug? or is there any way to properly escape the '?' character ?

Please help, thanks!
Regards,
Ed Zehoo

Options: ReplyQuote


Subject
Written By
Posted
the '?' character can't be escaped?
October 12, 2004 05:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.