Page 1 of 1

space in string parameters...

Posted: Mon 24 Nov 2014 04:18
by Willo
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?

Re: space in string parameters...

Posted: Mon 24 Nov 2014 10:19
by ViktorV
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.