Looking for a MySQL equivalent for SQL Server's ISNULL function?

SQL Server has a well known and widely used ISNULL function that actually replaces a null column value or null subquery value with whatever you specify. For example, if you were to write

view plain print about
1SELECT ISNULL(UnitPrice,0)
2FROM InventoryItem

then you would have zeros returned in your result set for all InventoryItem table records that had a NULL value for the UnitPrice field. Ever tried to do that in MySQL? It doesn't work because MySQL's ISNULL function simply returns a value telling you whether or not the argument to the ISNULL function was NULL or not. Not as cool when compared to SQL Server's nifty replace type of functionality now is it? But wait, no need to talk smack about MySQL - for there is another great and easy to use command in MySQL that will give us the same result!

[More]

Using jQuery load in place of a cfdiv

As many of you know, yesterday I ventured into the world of jQuery for the first time. I'm a little late to the party so I've decided that in order to get proficient with jQuery before the apocalypse I'm going to have to use it in my everyday client development tasks.

To give you some background, I have a long, on-going project where I'm creating a warehouse management/manufacturing application using ColdFusion 8 and SQL Server 2005. The app is huge and I've been using lots of out of the box cfajax widgets and cfajaxproxy to do cool things. I wanted to see how tough it would be to make jQuery do the same type of thing that I would normally use a cfdiv to accomplish. The quick answer? Easy, easy, easy - so easy that I couldn't believe it and had to ask Ray Camden if it were truly that easy or if I had made some sort of lucky mistake. I said, "Ray - it's too fast and too easy" and he said "Is that even AIR that you're breathing???" so here we go!

[More]

My first foray into the world of jQuery

Well, I've finally gotten curious enough to give jQuery a try. Don't cry Adobe - your super powerful cfajaxproxy tag along with some of your widgets (which I don't know whether to hug or strangle on an hourly basis) have and will continue to serve me well. I finished my Certified ColdFusion Expert test earlier this month and now I'm on the prowl to learn something that will prove to be useful along with being exciting, challenging and new. It doesn't appear as though this jQuery phenomenon is going anywhere - so what do I have to lose!

[More]

Using CFAJAXPROXY to Check Yourself Before You Wreck Yourself!

Many web apps that are used for CRUD activities (INSERT, UPDATE and DELETE statements) employ tables that simply have what is often referred to as a manufactured key. Most people more commonly know this as an auto-increment or auto-numbered identity style of primary key and it is typically stored as a data type that's an integer of some sort. This is great until you're working on something a bit bigger, say a business app, and you want the key to a subsidiary table to hold meaning to the end user throughout the app. Perhaps you're setting up location codes or category codes for instance, the value 5 will probably not mean a lot to an end user when filtering inventory reports by location code and it unfortunately forces the user to perform mental lookups to remember that 5 truly means a location of 'Chicago'.

So let's say that you make the decision to structure lookup tables using user defined key values - would you know how to use CF to help maintain referential integrity in your database while not endlessly frustrating your end users?

[More]

Using CF and AJAX to dynamically show and hide divs based on database values

Showing and hiding form and document elements on a page can be pretty useful when you're trying to walk a user through a process and you only want them to interact with controls that are geared towards to the task at hand.

[More]

Delivering Event Driven Notifications to Users with AJAX

Have you ever wanted to notify a group of users that an event has taken place using a cfwindow or some other type of alert? Well here's a way!

[More]

A quick and easy way to customize ColdFusion's default loading message for cfdivs and cflayoutareas.

Have you ever wanted to juice up or possibly hide the default loading message for your cfdivs or cflayoutareas?

[More]

Date and Time formatting in MySQL

Most developers familiar with SQL Server have employed the easy to use CAST or CONVERT commands in order to properly format a date. Here's a simple example of CONVERT helping us get a value in the format of MM/DD/YYYY.

view plain print about
1SELECT CONVERT(VARCHAR(10), MyDateField, 101) AS MyDateFieldDisplay
2FROM TableName
This is a great command and it's very easy to use - but do you know how to format date and time values in a similar fashion when coding against a MySQL database? You can use the DATE_FORMAT command and here's how...

[More]

Previous Entries

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