Category Archives: Snippets

quick code tips for single elements, attributes, or details

CFTry and CFCatch to test database connection

Every once in a while our database server will be down, but the website server is fine. However, without a database, our application is not very useful. So I use this little snippet to output a custom message. I use … Continue reading

Posted in Code, Coldfusion, Problems & Fixes, Snippets | Comments Off on CFTry and CFCatch to test database connection

CFSelect Multiple and ListQualify

If you need a multiple selection list and need to display its values dynamically from a query you can do this in one line of code within your form. <cfquery name=”getstatus” datasource=”myDSN”> select All as status from orderstable UNION ALL … Continue reading

Posted in Code, Coldfusion, Snippets, SQL | Comments Off on CFSelect Multiple and ListQualify

coldfusion result attributes

During my exploration of the previous article I needed to view the SQL statement that was being dynamically generated. Fortunately Coldfusion has add the “result” attribute to cfquery. This allows you to see things like execution time, sql, sql arguments, … Continue reading

Posted in Code, Coldfusion, Snippets | Comments Off on coldfusion result attributes

SQL adding new columns to query

Sometimes a table has all the fields you need and sometimes it doesn’t. I sometimes need to create flag fields or summary fields to hold additional information. So here are the methods I use. Add a 1 char flag field … Continue reading

Posted in Code, Snippets, SQL | Comments Off on SQL adding new columns to query

Select option [0] value

I have an application that allows the user to look up order detail. When they click on that order number they can open a trouble ticket. I pass most of the order information to the trouble ticket which is built … Continue reading

Posted in Code, Javascript, Snippets | Comments Off on Select option [0] value