The formatting of table and field names varies considerably across data sources. As a working standard for data sources, ODBC defines a naming convention that developers can follow in database construction. Adhering to the standard makes your code more portable, giving you increased deployment flexibility and significantly decreasing the cost of scaling applications to higher-performance database systems.
The standard requires that names begin with a letter and consist only of letters, numbers, and the underscore character. ColdFusion uses the same standard for identifying query columns. Therefore, the tables and queries you use with ODBC and ColdFusion must also adhere to this standard.
Although ODBC allows spaces in table names, ColdFusion does not. You must use aliases to access tables and field names that contain spaces. In addition, some data sources require you to specify table owner and table qualifier information to access the data source.
It is possible to sidestep the ODBC/ColdFusion naming requirements by enclosing references to nonstandard names with the backquote ( ` ) character and by using the SQL "AS" keyword to alias nonstandard names into standard names. However, these techniques are burdensome and lead to the creation of non-portable code that is significantly less readable.
|