Error: Invalid character (909) with MySQL

forum.connectivity (2000-2005) & forum.td.connectivity (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Error: Invalid character (909) with MySQL

Post by NewsgroupServer » 12 Jan 2009, 13:40

 Posted by:  Dirk Bellman 

I need your knowledge. My aplication work fine with MySQL-ODBC (5.15)
conection.

I have a problem with the following SQL-statement:

This statement s OK:

INSERT INTO table
SET id = 5,
field1 = 'Value1',
field2 = '\'Value2';

But with this statement, I got the errormessage "909 Invalid character"

INSERT INTO table
SET id = 5,
field1 = 'Value1',
field2 = '\'Value2\'';

If I use SQL-Talk, there is no problem.

Have anyone an idea?

Regards,
Dirk

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Error: Invalid character (909) with MySQL

Post by NewsgroupServer » 12 Jan 2009, 22:53

 Posted by:  Fabricio Suárez 

The invalid character is ';'

SQL Talk uses ';' to locate a command, without ';' SqlTalk sends the
error number 05041 TLK NCF No command found to process

but TD doesn't

Try this:

INSERT INTO table
SET id = 5,
field1 = \'Value1\',
field2 = \'Value2\'

Cheers

Fabricio

Dirk Bellman escribió:

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Error: Invalid character (909) with MySQL

Post by NewsgroupServer » 13 Jan 2009, 07:53

 Posted by:  Dirk Bellman 

Hallo Fabricio,

I know, that TD ';' dosen't need. I don't use this in TD. The Problem is,
the second "\'" in line 4. I need two "'" in the String.
The content after excecude in the database has to bee 'Value2'.

1 -> INSERT INTO table
2 -> SET id = 5,
3 -> field1 = \'Value1\',
4 -> field2 = \'\'Value2\'\';

Regards,
Dirk

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Error: Invalid character (909) with MySQL

Post by NewsgroupServer » 13 Jan 2009, 09:14

 Posted by:  Christof Helm 


I don't know much about MySql via ODBC, but with Oracle you need to use
two apostrophs to mark one as a literal:

1 -> INSERT INTO table
2 -> SET id = 5,
3 -> field1 = \'Value1\',
4 -> field2 = \'\'\'Value2\'\'\'

Or better readable in TD when using double quotes:

"INSERT ITO table
SET id = 5,
field1 = 'Value1',
field2 = ''Value2''"

Hth,
Christof

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Error: Invalid character (909) with MySQL

Post by NewsgroupServer » 13 Jan 2009, 10:45

 Posted by:  Dirk Bellman 


I think, that the second backstoke is the problem. If I write

INSERT INTO table
SET id = 5,
field1 = \'Value1\',
field2 = \'\'Value2\'

everythink goes right. Is there another masking backstroke, i get the error.

Return to “td.connectivity”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests