Friday, September 03, 2004

Last thing you look at....

Being a ColdFusion developer I have a subscription to the indispensable treasure trove known as ColdFusions Developer Journal magazine. Each month it comes with some very interesting techniques, ideas and methodologies for the CF developer. The July 2004 issue is one of the best, I feel, particularly two articles. I've been trying to work with the examples and learn the two techniques described in "Harnessing the Power of SQL Server Using Stored Procedures" and "ColdFusion Components and Data Abstraction - Part 2". I setup a nice little working example that would call the CFC to return the results of a stored procedure from a SQL Server table. It would then generate a nice table list to select the records. Clicking on a record would take me to the records detail. I used an interesting way of retrieving the data from the database by using the CFC like an object, as mentioned in the second of the aforementioned articles, but when I did there was always an extra space around the string value. After much time comparing the code in the magazine, downloading the code from the web site and trying it, I finally found out the cause. In my cffunction I had neglected to insert a attribute of output="no", which after I added that (the output attribute wasn't present before) the string came through without the extra padding. Isn't it always the last thing you look at?

No comments: