foundeo / toscript

Converts Tag based CFML to CFML Script
GNU General Public License v3.0
20 stars 9 forks source link

cfquery is not handled properly #1

Closed ryanguill closed 7 years ago

ryanguill commented 7 years ago
<cfquery name="local.test" result="local.qResult">
select * from myTable 
where x = <cfqueryparam cfsqltype="cf_sql_char" value="#arguments.x#">
order by y ASC
</cfquery>

becomes

cfquery( name="local.test", result="local.qResult" ) {

writeOutput("select * from myTable 
where x =");
cfqueryparam( cfsqltype="cf_sql_char", value=arguments.x );
writeOutput("order by y ASC");
}
pfreitag commented 7 years ago

Hey Ryan -- that syntax actually does work on both ACF and Lucee!

I realize that using queryExecute would be better, but for queries that include nested logic I found it pretty complicated to convert.

ryanguill commented 7 years ago

my apologies, I never expected that code to work properly!

pfreitag commented 7 years ago

No prob!

I will be adding a comment to state that queryExecute is preferred syntax.

Here is a link to a gist on trycf showing that this sort of code does work incase anyone comes across this issue from a search engine, etc: http://trycf.com/gist/996760b766736639d4a8c5bfe9531637/acf11