Category Archive for: Using Advance Query Techniques

Formatting Times

Just as you used Date Format to convert ColdFusion’s internal dates into user-readable formats you can use Time Format to do the same for times. By default the ColdFusion date format stores information about both date and time and these same values are used by TimeFormat to produce user-friendly strings TimeFormat takes two arguments: TimeFormat(Time ,Mask). By default…

Read More →

Formatting Currencies

ColdFusion provides the Do11arFormat function to display a number as a currency formatted with two decimal places a comma as a thousands separator and a dollar sign. Negative values are placed in parentheses Like Decimal Format Do11arFormat takes a single argument: Doll arFormat(Number). Therefore Do11arFormat(123456. 789) produces the following output: $123,456.79 Using a negative number such as Doll…

Read More →

Ntesting and Grouping Output

The power of CFOUTPUTbecomes even more apparent when you start to look at nesting or embedding,’, one CFOUTPUTtag within another. This technique ties in closely with the GROUPattribute that you just looked at and shows the real power of grouping. Although it is useful to be able to eliminate duplicatesconsider the following example. You want to output an…

Read More →

Optimizing Your Connedion

When your ColdFusion application starts to slow down especially during queries then it is time to analyze and improve your application’s performance. You can optimize the performance of your queries by making modifications to your SQL statements Administrator and data source settings and your database configuration. SQL Suggestions Optimizing your SQL queries means that elements in your queries…

Read More →

CFPROCRESULT

Using the CFPROCRESUL T tag allows you to access the data returned by the CFSTOREDPROC tag by defining a name for the result set. The CFPROCRESUL T tag is nested within the CFSTOREDPROC tag. Because stored procedures can return multiple result sets you can specify multiple CFPROCRESUL T tags. They are described in Table 11.5. CFPROCRESUL T has several…

Read More →

ALTER

If you would like to alter an existing table, you may do so with the ALTER clause. The syntax for the alter clause is ALTER TABLE tabl e_name ADD IDROP IMODIFY ( co 1umn_defi ni ti ons). The pipe ( I) sign is used in the syntax to indicate that you can use any of the keywords: ADD,…

Read More →

Combining Query Results

There may be cases where you need to merge the result set from one query with the result set of one or more different queries. There are three set operators that can be used to combine query result sets (see Table 11.2) In a UNION, the queries can pull data from any table as long as the…

Read More →

CrQSS Join

A Cross Join usually occurs when a programmer has forgotten to include a join in their SQL statement. The total results from a Cross Join are calculated by multiplying the number of rows in the first table by the number of rows in the second table. This is also called a Cartesian product. Even on tables with minimal…

Read More →

Using Advance Query Techniques

This chapter delves into some more advanced techniques for connecting your Web site to a database optimizing your code troubleshooting your errors and improving your performance and speed. This is probably one of the more important chapters of the book. Once these techniques are mastered you will have progressed from a beginner ColdFusion developer into the Intermediate to Advanced…

Read More →

Back to Top