space in string parameters...

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Willo
Posts: 34
Joined: Thu 24 Aug 2006 18:29

space in string parameters...

Post by Willo » Mon 24 Nov 2014 04:18

Hi;
im creating a master/detail relationship using a script like the one below:

Code: Select all

Select *,
r.po_nom,a.ag_nom,c.descrip,o.nom,
concat_ws(' ',trim(sl_obs1),trim(sl_obs2),trim(sl_obs3),trim(sl_obs4)) as observaciones,  
((sl_pri-sl_descto)+sl_derp+sl_pfra+sl_iva) as primatotal
 from polizas 
left outer join ramos r on sl_tipo=po_cve
left outer join compania o on sl_cia=cia
left outer join agentes a on sl_age=ag_cve
left outer join coberturas c on sl_cob=clave
where sl_pol=:sl_pola and sl_cia=:sl_ciaa
My problem is when :sl_pola (a string) pass a value that includes a space like "HTG 9324"
it didin't find the value.

how to include sigle quotes on parameters?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: space in string parameters...

Post by ViktorV » Mon 24 Nov 2014 10:19

According to MySQL documentation (http://dev.mysql.com/doc/refman/5.1/en/ ... erals.html), you can enclose a string in both double and single quotes if ANSI_QUOTES mode is not used. Please check whether you are using the ANSI_QUOTES mode. If it is enabled, disable it and check if the problem still persists.

Post Reply