To mark the 101st post on my Blog, and to complement my thoughts on what content I wish to publish on my blog in order to keep it current, I have decided that I will be writing some material on the following areas:
- 101 - ColdFusion variables and scopes, to include complex and simple variable types.
- 101 - Anatomy of a ColdFusion CFC.
- ColdFusion by Example - A series of posts that provide examples of some of the most commonly used ColdFusion Tags and Functions grouped by type, with practical examples.
- Syntax is easy, programming is hard. A general guide on how to concentrate more on the actual programming side of development rather than getting caught up with the syntax!
It's a tall order, I know, and it'll take discipline in order to keep the momentum going with this, but the idea is to provide some useful output during this process e.g. code snippets \ templates along the way that can be used and altered by anyone (including me) during development.
Recently I was working on some SQL scripts using TSQL in SQL Server Management Studio and from force of habit I was using the "GO" statement between each of my SQL statements to seperate them.
I then started re-factoring the SQL, creating variables where I had hardcoded values etc. and placed those variable declarations at the top of the script.
After re-factoring, I executed the scipt and got an error message saying that the variable @varName was not defined?
I checked for any typos...none. I then started breaking down the script to see if I could isolate the issue. When I removed the "GO" statements, the script executed without error.
It turns out that "GO" is not a TSQL statement, but rather a command that is recognised by the sqlcmd and osql utilities and SQL Server Management Studio. These utilities interpret the "GO" statement as a signal that it should send the current batch of TSQL statements to an instance of SQL Server. Therefore any variables declared before the last "GO" and the next will NOT be available in the current batch of statements.
Just for fun I then copied my TSQL into a <cfquery> and when I executed this, found that the same error was thrown.
One to watch out for if you're not familiar with the true definition of the "GO" statement.
Full details of the "GO" statement can be found here: http://msdn.microsoft.com/en-US/library/ms188037(v=SQL.90).aspx
If you haven't noticed already...
In the run-up to Christmas, I thought it would be nice to add some festive cheer to the "Homepage" of my blog!
For some reason my preference was to add Christmas lights over any other potential effect. So here it is.
These lights don't just flash either, you can also smash them with your mouse pointer and alter their size.
To alter their size, simply append any of the following options to the URL:
NOTE: There are sound clips used when smashing the lights so please ensure your speaker volume isn't too high (especially if you're in the office!!).