" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

CFQUERY bug on using different datasources within a single query

Posted on November 23rd, 2015 by Swastik Sen

Recently, I encountered an interesting bug in CFQUERY. Here isĀ an example with detailed explanation. <cfquery name=”GetParks” datasource=”MYSQLdsn”> SELECT parkname, region, state FROM Parks <!— checks the return value (boolean) of function —> <cfif countRecord()> ORDER BY parkname, state </cfif> </cfquery> If we call an UDF named countRecord() from within a CFQUERY, and that query uses […]

Bug in script version of cfquery

Posted on November 23rd, 2015 by Upendra Roul

We generally use ColdFusion tags in our coding. But sometimes we prefer to use script version of that, instead the tag. Also in ColdFusion 9.0.1 have a script version code for almost every tags. In ColdFusion 9.0.1 the script version of cfquery has a bug as follows. Let our table name is “USERS(USER_ID, FIRST_NAME, LAST_NAME, […]

Creating Connection Object

Posted on November 23rd, 2015 by Pratibind Jha

Run a SQL query in cfscript by creating a connection string by accessing the servicFactory If we want to execute a Query like underneath in cfscript:– SELECT UserName,Email,UserType FROM UserInfo WHERE UserName = <cfqueryparam cfsqltype=”CF_SQL_VARCHAR” value=”#form.username#”> AND UserID = <cfqueryparam cfsqltype=”CF_SQL_INTEGER” value=”#session.UserID#”> NOTE: Here connceting to database and SQL injection(SQL Attack) is control by coldfusion […]