Page 1 of 1

REPLACE FUNCTION not working with VS2005

Posted: Mon 02 Mar 2009 17:50
by Scarpellin
Using VS2005 query designer - connector v. 4.0, in a DataSource object I try this query:

SELECT * FROM table_name
WHERE (REPLACE(FieldName, 'aa', 'b') = 'bb' )

The designer transforms it in

SELECT * FROM table_name
WHERE (`REPLACE`(FieldName, 'aa', 'b') = 'bb' )

and when I execute, I get an error '...FUNCTION database_name.REPLACE does not exist'


Any suggestion?

Posted: Tue 03 Mar 2009 08:49
by Shalex
Please refer to http://www.devart.com/forums/viewtopic.php?p=31415 . REPLACE, LIMIT and other keywords that are not supported in MS SQL Server cannot be used for other databases through Query Builder. This is a limitation of Query Builder.

Posted: Tue 03 Mar 2009 09:30
by Scarpellin
OK, I suspected the problem was the query-designer.
I solved building mysql connection and command directly in code.
I found also that making 'non standard' queries in the designer is risky: sometimes the VS crashes and loses the dataset XML descriptor file.