Is there a difference in using :locale or #locale# in query in cfscript?

Hi,

if I have something like

var queryService = new query();
queryService.setName(“BlaBlub”);

queryService.setDatasource(“#application.wheels.dataSourceName#”);

queryService.addParam(name=“defaultLocale”,value=“#application.defaultLocale#”,cfsqltype=“VARCHAR”);

queryService.addParam(name=“locale”,value=“#arguments.locale#”,cfsqltype=“VARCHAR”);

queryService.setSQL("
SELECT DISTINCT
COALESCE(countries.Country_:locale,
countries.Country_#defaultLocale#) AS Country

Is it better to use the syntax :locale or #locale# in the concatenated
fieldname?
Both versions does work.

Regards
Thorsten

Pretty sure when writing in cfscript you can lose the quotes and #hash
tags# in the params;

queryService.addParam(name=“locale”, value=arguments.locale,
cfsqltype=“VARCHAR”);

I’ve never used cfwheels but you might be able set the datasource without
quotes and #hash tags#,

queryService.setDatasource(application.wheels.dataSourceName);

I believe you were right with this,

queryService.setSQL(“SELECT DISTINCT COALESCE(countries.Country_:locale)
AS Country”);

Hi,

if I have something like

var queryService = new query();
queryService.setName(“BlaBlub”);

queryService.setDatasource(“#application.wheels.dataSourceName#”);

queryService.addParam(name=“defaultLocale”,value=“#application.defaultLocale#”,cfsqltype=“VARCHAR”);

queryService.addParam(name=“locale”,value=“#arguments.locale#”,cfsqltype=“VARCHAR”);

queryService.setSQL("
SELECT DISTINCT
COALESCE(countries.Country_:locale,
countries.Country_#defaultLocale#) AS Country

Is it better to use the syntax :locale or #locale# in the concatenated
fieldname?
Both versions does work.

Regards
Thorsten

On Saturday, April 23, 2016 at 2:38:03 PM UTC-5, mark wrote:
On Saturday, April 23, 2016 at 2:36:37 PM UTC-5, mark wrote:
On Saturday, April 23, 2016 at 12:11:59 PM UTC-5, thorste...@googlemail.com wrote: