Query of Queries Trims Whitespace Automatically

After literally hours of tracking down what was causing a large code base to behave badly, I found an odd and frustrating features when doing a query of queries with <cfquery>. Take the following code as an example of what you would think works:


<cfquery name="q1" datasource="#application.DSN#">
    SELECT ' A2010 ' as v1
    FROM Seasons
    WHERE teamid = <cfqueryparam value="18513" cfsqltype="cf_sql_integer">
</cfquery>

<cfquery name="q2" dbtype="query">
    SELECT v1
    FROM q1
    WHERE LOWER(v1) = '#Lcase(' A2010 ')#'
</cfquery>

The above code will return 10 results for q1 but none for q2 even though they are both matching " 2010 ".

To fix the issue I tried using in the second query and even tried replacing the space with a #chr(32)# character code. Neither worked.

Changing the query to the following works:


<cfquery name="q1" datasource="#application.DSN#">
    SELECT ' A2010 ' as v1
    FROM Seasons
    WHERE teamid = <cfqueryparam value="18513" cfsqltype="cf_sql_integer">
</cfquery>

<cfquery name="q2" dbtype="query">
    SELECT v1
    FROM q1
    WHERE LOWER(v1) = '#Lcase('A2010')#'
</cfquery>

Notice I removed the space before and after the 2010 in the second query. This will return all 10 results even though it is not an exact match.

ColdFusion is automatically trimming the whitespace of the values returned from q1.

The only solution I can find is to trim the value to match as well. This will provide for an inexact match, but will work for my purpose. This is very concerning because you could have a lack of results and not even know it without inspecting it.

The final code I've come up with for a "sorta-fix-workaround" is:


<cfquery name="q1" datasource="#application.DSN#">
    SELECT ' A2010 ' as v1
    FROM Seasons
    WHERE teamid = <cfqueryparam value="18513" cfsqltype="cf_sql_integer">
</cfquery>

<cfquery name="q2" dbtype="query">
    SELECT v1
    FROM q1
    WHERE LOWER(v1) = '#Lcase(Trim(' A2010 '))#'
</cfquery>

Getting Rocketfish Keyboard to Work on Windows 7

I tried adding my bluetooth Rocketfish Keyboard to my new Windows 7 laptop this weekend using the Rocketfish USB dongle. My Rocketfish Bluetooth mouse added just fine. When adding via the Bluetooth dialog, I could see the keyboard - however when you add it it just tries to connect.

Thanks to Technet's social board I found the solution. When you go to add the device, right click on the keyboard icon and click on properties. In the servies tab, check the box that says Drivers for keyboard, mice, etc (HID). It now works great!

Pinnacle Black Friday? What A Joke!

I received an email today stating "4 days of incredible savings, starting in 2 days" frm Pinnacle Systems. At first I see "Over $200 off!" on the Studio Ultimate Collection v14 Bundle. So I think to myself, hmm... I should check this out. Get a $340 product for only $130... Cool!

But wait, I click through their site to find the product as is right now, and what do I find, but yes... it's only $130! Isn't that a couple of days early? Or perhaps just another case of false advertising. Guess I won't be buying from them.

http://www.pinnaclesys.com/blackfriday/

Cox Cable and HD Receivers

I just wanted to pass along some tips to avoid frusteration if you have Cox Cable and decide to get a HD receiver from them.

I went to the local Cox office and signed up for the HD gateway and to lease the HD receiver. I came home, with receiver in-hand and hooked it up to my tv via a HDMI cable. Seemed to work great. To disable the anti-theft feature and activate certain services, I called the activation number. This in-turn sent a signal to my box and reset it. It worked no more!

So I called tech support who stepped me through some things, but then ended up scheduling me an appointment with a onsite technician to resolve the problem. But hey, I have a new toy and want it to work now. So I went back to the office and exchanged the receiver. Same thing.

I went back a third time and got another one, willing to try it once more. With everything hooked up I called the activation number. Nothing happend. So I called tech support to make sure everything was okay on their end. He said that they missed putting in the HD codes. That's why the HD signal was being disabled when they activated it. So he put in the codes and tried to send the signal. Nothing. Figuring that I may actually have a bad box, he asked me to wait for the technician.

The technician shows up, makes a call to register the serial number, redoes some of the connections on the cables, and bam! it works!

So if you ever run into issues while hooking up your HD receiver to Cox, check these things with them over the phone before going bezerk:

  1. Be sure they have entered your HD codes into their configuration for the the device.
  2. Be sure that they have the proper serial number registered for you.
  3. Be sure that you have good ends on your cables and that you have a proper signal strength coming into your house.

I hope this helps someone save almost a week a frusteration.

HDMI Cables and Your Money

Lately I've upgraded my TV from the tube to the LCD. Nice. But wait - now I need new furniture to replace my bulky entertainment center. Ooh - now I need better sound; yep 5.1 dobly digital sound. Well, standard cable just isn't up to par, so now I have to go get a HD cable box.

Upgrading to the HD "lifestyle" is like a Jeep. It's a never-ending money pit. Good luck catching me buying Blueray, well at least not yet.

But here's one money saving tip - eBay! I went to cox to pickup the HD box, something like $6/mo. But wait to hook it up via the HDMI cable, it's another $60 upfront! No way! Go to eBay, search for HDMI Cable (at least ver 1.3) and wam-bam, six bucks. That's a $52 savings for a stupid cable! Granted you may not get the pretty packaging, but who cares. eBay!guys. Audio cables, video cables, all cheap cheap cheap, and they work the same.

Tag Insight Not Working for CFEclipse Beta

I am using CFEclipse 1.3.2beta with Eclipse SDK version 3.3.2 with Aptana. The tag insight (tag completion) feature was not working. After a little research I found that if you right click on the project and select Add/Remove CFE Nature, tag insight will start working again.

Now if only it would add automatic slashes at the end of self-closing tags and give me standard tag property option insight life would be great. I miss you Dreamweaver!

Font Annoyance

Issue:
While doing a little copying/pasting with some modifications of ColdFusion pages with HTML output, I could not figure out what was causing my fonts to go all screwy. The font for that page was showing up almost twice as big than what it was supposed to be! This issue was found in Internet Explorer 7, while FireFox 3 was showing properly, making it all that more difficult to diagnose.

Resolution:
I was including a ColdFusion page as an event handler before anything else, including the pages head section. What I found was a "<!--- blah --->" being inserted as the first thing in the HTML code. Using the process of elimation, I silenced the output and TA-DA!

Conclusion:
Don't put HTML comments before the head section!

Running direct .SWF (Flash) URL's in IE 7

Some people are IE users and some are FireFox. I'm an IE user. Don't have a specific reason but; one it's what most of the population uses; and two it's what I'm most comfortable with.

But of course there are some annoyances. Lately I've been running into an "Object Expected" javascript error when trying to open direct .SWF files (i.e. http://www.mysite.com/flash.swf). With this issue I'm running IE 7 on Windows XP Pro SP3. I took a quick look at this and found a simple solution. Why this must be done I have no idea and seems pretty stupid but here we go.

--> Deselect "Allow active content to run in files on my computer" <--

This can be found under Tools -> Options -> Advanced -> Security Settings

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner