Dynamic SQL allows you to dynamically determine which parts of a SQL statement are sent to the database. So if a user leaves a search field empty, for example, you could simply omit the part of the WHERE clause that refers to that field. Or, if a user does not specify a sort order, the entire ORDER BY clause could be omitted. |
Cold Fusion uses CFIF/CFELSEIF/CFELSE tags to control how the SQL statement is constructed.
|