Backslash adding in CONCAT in calculated field [message #1482] |
Tue, 15 July 2008 16:56 |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
I defined this calculated field in a relationship:
CONCAT_WS(',',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det
when I saved it it was automatically transformed to:
CONCAT_WS(\',\',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det
So when running the application I got this error:
Fatal Error: MySQL error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\',\',participante.catsalut, participante.nombre, participante.apellido1,partici' at line 1 (# 1064).
SQL query: SELECT SQL_CALC_FOUND_ROWS equipo.equipo_id, participante.participante_id, CONCAT_WS(\',\',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det,
|
|
|
Re: Backslash adding in CONCAT in calculated field [message #1485 is a reply to message #1482] |
Tue, 15 July 2008 20:17 |
AJM
Messages: 2371 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I have tried this on my system and I cannot get it to fail. When I use a CONCAT expression in a relationship the single quotes are not escaped on the screen. You can see for yourself in the demonstration system by going to Home->Dictionary->Databases, select 'Xample', press 'Tables', select 'x_person', press 'Relationships (table)' followed by 'select all' and 'Read'.
Each single quote is escaped just once when it is exported to the <table>.dict.inc file, so the resulting sql satement is perfectly valid.
I assume you are using the latest version of Radicore?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|