<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Dev Pages &#187; Coldfusion</title>
	<atom:link href="http://www.n8williams.com/devblog/category/coldfusion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.n8williams.com/devblog</link>
	<description>A knowledge base for simple (and beyond) web applications development</description>
	<lastBuildDate>Fri, 21 May 2010 12:30:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blank Coldfusion errors on Query of Queries using like clause</title>
		<link>http://www.n8williams.com/devblog/coldfusion/blank-coldfusion-errors-on-query-of-queries-using-like-clause</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/blank-coldfusion-errors-on-query-of-queries-using-like-clause#comments</comments>
		<pubDate>Fri, 16 Jan 2009 01:40:34 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=60</guid>
		<description><![CDATA[[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.
If you have a string column that contains a null value, this occurs. You have to add a check for the null first. Note that the like clause is also case sensitive for query of queries.
Breaks:
SELECT * FROM myTable
WHERE 1=1
AND LOWER(name) LIKE &#60;cfqueryparam cfsqltype=&#8221;cf_sql_varchar&#8221; value=&#8221;%#LCase(searchCriteria.search)#%&#8221; /&#62;
Works:
SELECT [...]]]></description>
			<content:encoded><![CDATA[<p>[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.</p>
<p>If you have a string column that contains a null value, this occurs. You have to add a check for the null first. Note that the like clause is also case sensitive for query of queries.</p>
<p>Breaks:</p>
<p>SELECT * FROM myTable<br />
WHERE 1=1<br />
AND LOWER(name) LIKE &lt;cfqueryparam cfsqltype=&#8221;cf_sql_varchar&#8221; value=&#8221;%#LCase(searchCriteria.search)#%&#8221; /&gt;</p>
<p>Works:</p>
<p>SELECT * FROM myTable<br />
WHERE 1=1<br />
AND name is not null AND LOWER(name) LIKE &lt;cfqueryparam cfsqltype=&#8221;cf_sql_varchar&#8221; value=&#8221;%#LCase(searchCriteria.search)#%&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/blank-coldfusion-errors-on-query-of-queries-using-like-clause/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldspring Remote Service Bean can&#8217;t have spaces in remoteMethodNames</title>
		<link>http://www.n8williams.com/devblog/coldfusion/coldspring-remote-service-bean-cant-have-spaces-in-remotemethodnames</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/coldspring-remote-service-bean-cant-have-spaces-in-remotemethodnames#comments</comments>
		<pubDate>Thu, 08 Jan 2009 22:02:25 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=57</guid>
		<description><![CDATA[&#60;property name=&#8221;remoteMethodNames&#8221;&#62;NO SPACES HERE!!!! METHOD NAMES MUST BE COMMA DELIMITED WITH NO SPACES&#60;/property&#62;
]]></description>
			<content:encoded><![CDATA[<p>&lt;property name=&#8221;remoteMethodNames&#8221;&gt;NO SPACES HERE!!!! METHOD NAMES MUST BE COMMA DELIMITED WITH NO SPACES&lt;/property&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/coldspring-remote-service-bean-cant-have-spaces-in-remotemethodnames/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldfusion cfqueryparam of type decimal, cf_sql_decimal, requires the scale argument</title>
		<link>http://www.n8williams.com/devblog/coldfusion/coldfusion-cfqueryparam-of-type-decimal-cf_sql_decimal-requires-the-scale-argument</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/coldfusion-cfqueryparam-of-type-decimal-cf_sql_decimal-requires-the-scale-argument#comments</comments>
		<pubDate>Wed, 08 Oct 2008 16:23:46 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=50</guid>
		<description><![CDATA[I learned the hard way that if you don&#8217;t include the scale attribute in the cf_sql_decimal cfqueryparam tag, then your decimal gets rounded to the nearest whole number. IF this isn&#8217;t what is intended, this can really bite. Make sure you specify the scale with the scale argument to make you cfqueryparam as accurate as [...]]]></description>
			<content:encoded><![CDATA[<p>I learned the hard way that if you don&#8217;t include the scale attribute in the cf_sql_decimal cfqueryparam tag, then your decimal gets rounded to the nearest whole number. IF this isn&#8217;t what is intended, this can really bite. Make sure you specify the scale with the scale argument to make you cfqueryparam as accurate as intended.</p>
<div class="text-box"><code>&lt;cfqueryparam cfsqltype="cf_sql_decimal" scale="8" value="#decimalvar# /&gt;</code></div>
<p>WRONG (Unless whole numbers desired):</p>
<div class="text-box"><code>&lt;cfqueryparam cfsqltype="cf_sql_decimal" value="#decimalvar# /&gt;</code></div>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/coldfusion-cfqueryparam-of-type-decimal-cf_sql_decimal-requires-the-scale-argument/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFML is NOT the Cambodian Midget Fighting League</title>
		<link>http://www.n8williams.com/devblog/coldfusion/cfml-is-not-the-cambodian-midget-fighting-league</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/cfml-is-not-the-cambodian-midget-fighting-league#comments</comments>
		<pubDate>Fri, 04 Jul 2008 14:36:51 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=41</guid>
		<description><![CDATA[I&#8217;ve noticed a lot of confusion about the acronym CFML (Coldfusion Markup Language) in connection with the other well-known acronym CMFL (Cambodian Midget Fighting League). The CMFL had an incident where an African lion defeated, and killed many of 42 midget fighters in a government sanctioned fight, which resulted in an increased status in the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed a lot of confusion about the acronym CFML (Coldfusion Markup Language) in connection with the other well-known acronym CMFL (Cambodian Midget Fighting League). The CMFL had an incident where an African lion defeated, and killed many of 42 midget fighters in a government sanctioned fight, which resulted in an increased status in the already popular league. Consequently, many coldfusion developers should be aware to use the proper tags and extensions that use CFM and not CMF, as such similar and popular acronyms are bound to clash often. I have already come across such errors often in my limited dev experience.</p>
<p>Summary: CF developers, don&#8217;t let the CMFL take precedence in your mind over CFML.</p>
<p><a title="http://www.lionvs40midgets.uk-directory.com/lionvsmidgets.htm" href="http://www.lionvs40midgets.uk-directory.com/lionvsmidgets.htm" target="_blank">http://www.lionvs40midgets.uk-directory.com/lionvsmidgets.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/cfml-is-not-the-cambodian-midget-fighting-league/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Throw errors in a cfscript and try catch in cfscript</title>
		<link>http://www.n8williams.com/devblog/coldfusion/throw-and-try-catch-in-cfscript</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/throw-and-try-catch-in-cfscript#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:51:41 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=36</guid>
		<description><![CDATA[You CAN&#8217;T throw an error or errors from a cfscript without defining your own throw function. But this is pretty easy to do. Somewhere else in your code, just write a &#60;cfunction name=&#8221;throw&#8221; etc. and in this function just put a &#60;cfthrow tag that throws the error you want to be thrown. A good practice [...]]]></description>
			<content:encoded><![CDATA[<p>You CAN&#8217;T throw an error or errors from a cfscript without defining your own throw function. But this is pretty easy to do. Somewhere else in your code, just write a &lt;cfunction name=&#8221;throw&#8221; etc. and in this function just put a &lt;cfthrow tag that throws the error you want to be thrown. A good practice would be to include a throw function in a utility cfc that you could invoke wherever you needed to throw an error in a cfscript.</p>
<p>See the example code below. Note the interesting syntax for catching in a cfscript where you do catch(ERRORTYPE CFCATCHVARIABLE). So catch(database e), catch(any e) would be some common ones. And then you could access e.Message, e.Detail, etc.</p>
<div class="text-box"><code>try<br />
{<br />
     //nothing below the throw would execute in this example.<br />
     //But I left the rest for syntax reference.<br />
     somethingWrong=true;<br />
     if(somethingWrong){<br />
          throw("ExampleErrorType","Example Error message.");<br />
}<br />
     //save the reactor record without interfering with custom transaction<br />
     template1.save(useTransaction=false);<br />
}<br />
catch (database err)<br />
{<br />
     //if the save fails and the error is a database error, return the error detail.<br />
     //otherwise this error will need to be caught by the code calling this code.<br />
     return  err.Detail;<br />
}</code></div>
<p>If you want to do a rethrow, the following article has a great example.<br />
<a title="http://www.coldfusionjedi.com/index.cfm?mode=entry&amp;entry=3089633C-9FA0-606B-3F540AE9642A795F" href="http://www.coldfusionjedi.com/index.cfm?mode=entry&amp;entry=3089633C-9FA0-606B-3F540AE9642A795F" target="_blank">http://www.coldfusionjedi.com/index.cfm?mode=entry&amp;entry=3089633C-9FA0-606B-3F540AE9642A795F</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/throw-and-try-catch-in-cfscript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldspring init error &#8211; An error occured while Parsing an XML document.:Content is not allowed in prolog.</title>
		<link>http://www.n8williams.com/devblog/coldfusion/an-error-occured-while-parsing-an-xml-documentcontent-is-not-allowed-in-prolog</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/an-error-occured-while-parsing-an-xml-documentcontent-is-not-allowed-in-prolog#comments</comments>
		<pubDate>Thu, 26 Jun 2008 16:45:55 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=32</guid>
		<description><![CDATA[An error occured while Parsing an XML document.:Content is not allowed in prolog.
This mean coldspring cannot find the xml of an expandPath(), or a config argument.  On the init of a bean, the line in the init of the cfc was

the arguemtns.environmentXML came from the xml coldspring config,

			/environment/thecompany/settings.xml
		
My mappings on the server to the [...]]]></description>
			<content:encoded><![CDATA[<p>An error occured while Parsing an XML document.:Content is not allowed in prolog.</p>
<p>This mean coldspring cannot find the xml of an expandPath(), or a config argument.  On the init of a bean, the line in the init of the cfc was<br />
<cfset variables.environment = xmlParse(expandPath(arguments.environmentXML)) /></p>
<p>the arguemtns.environmentXML came from the xml coldspring config,</p>
<p><constructor-arg name="environmentXML"><br />
			<value>/environment/thecompany/settings.xml</value><br />
		</constructor-arg></p>
<p>My mappings on the server to the path were wrong.</p>
<p>C:\HOMEDEV\RESOURCES\localEnvironment\heritagemakers<br />
should have been<br />
C:\HOMEDEV\RESOURCES\localEnvironment</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/an-error-occured-while-parsing-an-xml-documentcontent-is-not-allowed-in-prolog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldspring error &#8211; Error Loading: bean_, The cause of this exception was: java.io.FileNotFoundException</title>
		<link>http://www.n8williams.com/devblog/coldfusion/coldspring-error-error-loading-bean_-the-cause-of-this-exception-was-javaiofilenotfoundexception</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/coldspring-error-error-loading-bean_-the-cause-of-this-exception-was-javaiofilenotfoundexception#comments</comments>
		<pubDate>Wed, 25 Jun 2008 20:18:22 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=31</guid>
		<description><![CDATA[Error Loading: bean_C15CD3571617EEF37B66D49B00F832B8, The cause of this exception was: java.io.FileNotFoundException: D:\HM\Branches\RanaRana\Coldspring\aop\framework\tmp\bean_C15CD3571617EEF37B66D49B00F832B8.cfc (The system cannot find the path specified).
Weird. You have to manually create the tmp folder under yourColspringInstall\aop\framework
]]></description>
			<content:encoded><![CDATA[<p>Error Loading: bean_C15CD3571617EEF37B66D49B00F832B8, The cause of this exception was: java.io.FileNotFoundException: D:\HM\Branches\RanaRana\Coldspring\aop\framework\tmp\bean_C15CD3571617EEF37B66D49B00F832B8.cfc (The system cannot find the path specified).</p>
<p>Weird. You have to manually create the tmp folder under yourColspringInstall\aop\framework</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/coldspring-error-error-loading-bean_-the-cause-of-this-exception-was-javaiofilenotfoundexception/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coldfusion database error resolutions log</title>
		<link>http://www.n8williams.com/devblog/coldfusion/coldfusion-database-error-resolutions-log</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/coldfusion-database-error-resolutions-log#comments</comments>
		<pubDate>Thu, 19 Jun 2008 16:08:32 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=28</guid>
		<description><![CDATA[&#8220;Unable to invoke CFC &#8211; [Macromedia][SQLServer JDBC Driver][SQLServer]The multi-part identifier &#8220;yourvariable&#8221; could not be bound.&#8221;
Your not putting pound signs around a variable name

SET @newOtherID = arguments.newUserID;

SET @newOtherID = #arguments.newUserID#;
faultString	&#8220;Unable to invoke CFC &#8211; [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near &#8216;yourfirstfewcharactersofaguid&#8217;.
Your not putting your GUID in quotes

SET @userguid = #arguments.newUserID#;

SET @userguid = '#arguments.newUserID#';
]]></description>
			<content:encoded><![CDATA[<p>&#8220;Unable to invoke CFC &#8211; [Macromedia][SQLServer JDBC Driver][SQLServer]The multi-part identifier &#8220;yourvariable&#8221; could not be bound.&#8221;<br />
Your not putting pound signs around a variable name<br />
<code><!--- WRONG ---><br />
SET @newOtherID = arguments.newUserID;<br />
<!--- RIGHT---><br />
SET @newOtherID = #arguments.newUserID#;</code><br />
faultString	&#8220;Unable to invoke CFC &#8211; [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near &#8216;yourfirstfewcharactersofaguid&#8217;.<br />
Your not putting your GUID in quotes<br />
<code><!--- WRONG ---><br />
SET @userguid = #arguments.newUserID#;<br />
<!--- RIGHT---><br />
SET @userguid = '#arguments.newUserID#';</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/coldfusion-database-error-resolutions-log/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the domain entered from the request. Coldfusion CGI.HTTP_HOST</title>
		<link>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:40:11 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Random Thoughts]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=27</guid>
		<description><![CDATA[Use CGI.HTTP_HOST
Issue: mydomain.com gets load-balanced and uses multiple servers. CGI.SERVER_NAME will not return &#8216;mydomain&#8217; but will return &#8217;sever1&#8242; or &#8217;server2&#8242; etc. 
I want to check the request URL, and if it does not include www, re-locate to www.mydomain/pagerequested?event=eventrequested

&#60;cfset secureurl = xmlParse(expandPath("/mydevenvironment/settings.xml")).
settings.secureHost.xmlText /&#62;
		&#60;cfloop collection="#CGI#" item="field"&#62;
			&#60;cfoutput&#62;#field#: #CGI[field]# &#60;BR&#62;&#60;/cfoutput&#62;
		&#60;/cfloop&#62;
		&#60;cfif NOT REFind("www\.", CGI.HTTP_HOST)&#62;
			
			&#60;cfif CGI.HTTPS EQ "on"&#62;
				&#60;cfset theURLBase = secureurl [...]]]></description>
			<content:encoded><![CDATA[<p>Use CGI.HTTP_HOST</p>
<p>Issue: mydomain.com gets load-balanced and uses multiple servers. CGI.SERVER_NAME will not return &#8216;mydomain&#8217; but will return &#8217;sever1&#8242; or &#8217;server2&#8242; etc. </p>
<p>I want to check the request URL, and if it does not include www, re-locate to www.mydomain/pagerequested?event=eventrequested</p>
<div class="text-box"><code><!--- Redirect to the site that corresponds to the securehost ---><br />
&lt;cfset secureurl = xmlParse(expandPath("/mydevenvironment/settings.xml")).<br />
settings.secureHost.xmlText /&gt;<br />
		&lt;cfloop collection="#CGI#" item="field"&gt;<br />
			&lt;cfoutput&gt;#field#: #CGI[field]# &lt;BR&gt;&lt;/cfoutput&gt;<br />
		&lt;/cfloop&gt;<br />
		&lt;cfif NOT REFind("www\.", CGI.HTTP_HOST)&gt;<br />
			<!--- If a secure request, keep the https, otherwise just go to http---><br />
			&lt;cfif CGI.HTTPS EQ "on"&gt;<br />
				&lt;cfset theURLBase = secureurl /&gt;<br />
			&lt;cfelse&gt;<br />
				&lt;cfset theURLBase = REREplace(secureurl,"https:","http:")/&gt;<br />
			&lt;/cfif&gt;<br />
			&lt;cfoutput&gt;#theURLBase#&lt;/cfoutput&gt;<br />
			&lt;cflocation url='#theURLBase##CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#'addtoken="false"&gt;<br />
		&lt;/cfif&gt;</code></div>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/get-the-domain-entered-from-the-request/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dynamic variable names</title>
		<link>http://www.n8williams.com/devblog/coldfusion/dynamic-variable-names</link>
		<comments>http://www.n8williams.com/devblog/coldfusion/dynamic-variable-names#comments</comments>
		<pubDate>Wed, 11 Jun 2008 21:43:08 +0000</pubDate>
		<dc:creator>Nate Admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.n8williams.com/devblog/?p=25</guid>
		<description><![CDATA[//note, in cf documentation &#8211; You can combine text and variable names to construct a variable name on the left side of an =
//To construct a variable name this way, all the text on the left side of the equal sign must be in quotation marks.
//The left side of an assignment can&#8217;t be a function [...]]]></description>
			<content:encoded><![CDATA[<p>//note, in cf documentation &#8211; You can combine text and variable names to construct a variable name on the left side of an =<br />
//To construct a variable name this way, all the text on the left side of the equal sign must be in quotation marks.<br />
//The left side of an assignment can&#8217;t be a function (So Evaluate wouldn&#8217;t work&#8217;)</p>
<p>						     	&#8220;local.criteria.#local.keysToStruct[local.i]#&#8221;=Evaluate(&#8221;arguments.criteria.&#8221; &#038; #local.keysToStruct[local.i]#);<br />
break;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.n8williams.com/devblog/coldfusion/dynamic-variable-names/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
