CFX_ODBCInfo

v2.0

05/PRIL/2004


© Claude Schnéegans

DESCRIPTION

returns in a query several types of information about datasources, tables and columns. Unlike some other custom tags found in Allaire's Tag Gallery, this tag uses standard ODBC API and thus is capable of working not only with Access files, but also on any type of ODBC database like Oracle and SQL Server.

Another characteristic is also that all functionalities returning informations about database are centralized in the same convenient tag: datasources on a server, tables inside datasources, columns inside tables.

CFX_OBDCInfo does not return any data contained in the database, but information about its structure like table names, table types, column names, types, sizes, default values, etc.

CFX_OBDCInfo works on the complete ODBC structure: the higher level inside a datasource being catalogs: catalogs contain schemas which contain database objects like tables which in turn contain columns. By supplying correct values to the tag attributes, the user may get lists and types about all these different objects levels.

Only large database systems use higher levels like catalogs or shemas. For instance an Access database has only one catalog, the database itself and no schemas.

NOTE

If you find this custom tag useful, or if you have any suggestion to make it even more useful, just let me know, I'll be glad to enhance it.

INSTALLATION

To use this tag, you need to take the included ODBCInfo.dll, install it on a drive on your server and make it known to the ColdFusion administrator.

You do this by going to the "CFX Tags" tab in the administrator,

  1. click the "add" button.
  2. Specify the name as CFX_ODBCInfo.
  3. For the Serverlibrary(dll), specify the path to the .dll (the directory into which you copied ODBCInfo.dll.
  4. It should say for "Procedure", "ProcessTagRequest".
That's it!

For more information refer to the ColdFusion documentation "Managing CFXs".
This tag uses standard Microsoft ODBC dynamic library and does not require any special piece of soft installed like DAO or other, except ODBC of course. It has been tested on Windows98 and NT.

Important Note:
This tag uses the following DLL which must be active on your system:

ADVAPI32.DLL 
COMCTL32.DLL 
COMDLG32.DLL 
GDI32.DLL 
KERNEL32.DLL 
MSVCRT.DLL 
ODBC32.DLL 
ODBCINFO.DLL 
SHELL32.DLL 
SHLWAPI.DLL 
USER32.DLL 
WINSPOOL.DRV 

If one of these files is missing, you will probabily get the following error message message:

Error loading CFX custom tag library


The library associated with the custom tag CFX_ODBCINFO
(c:\coldfusion\bin\cftags\odbcinfo.dll) was not found.

Please check the LibraryPath entry for this tag in the custom tag database to
verify that the library file exists and is accessible by the ColdFusion
service.

If you have only downloaded the demo version, any query returned by the tag will contain only the 5 first rows.
SYNTAX & TABLE OF CONTENT
<CFX_ODBCInfo NAME=
  DUMP="YES|NO"
  SELECT="DATASOURCES
  |DRIVERS
  |VERSIONS
  |CATALOGS
  |SCHEMAS
  |TABLETYPES
  |COLUMNTYPES
  |TABLES
  |INDEXES
  |COLUMNS"
  |PROCEDURES New!"
  |PRIMARYKEYS New!
  |FOREIGNKEYS New!
  DATASOURCE=
  CATALOG=
  PKCATALOG New!=
  FKCATALOG New!=
  SCHEMA=
  PKSCHEMA New!=
  FKSCHEMA New!=
  TABLE=
  PKTABLE New!=
  FKTABLE New!=
  TABLETYPE=
  COLUMN=
  UNIQUE
  ORDERBY=
  >

Tag & attribute list

Examples

TAG ATTRIBUTE CONTENT REQUIRED DEFAULT
<CFX_ODBCInfo NAME= Name of the query that will be returned by the tag. No ODBCInfo
DUMP= Giving the value "YES" to this attribute will make the tag directly generate the HTML table and rows in order to produce a dump of the content of the query. (see examples below).

Note: The TABLE tag will have a BORDER=1 and CELLSPACING=0. The Column names of the query will be listed inside <TH> tags and datarows inside <TD>. You can define background colors using <STYLE>(see examples below).

No "NO"
SELECT= This attribute may be used to specify the type of data which will be returned in the query. This attribute may take the following values:

DATASOURCES The query will return the list of all ODBC sources available on the system, one per row, and all other attributes are ignored. See below for the columns returned by the query and type of information available.

DRIVERS The query will return the list of all ODBC drivers available on the system, one per row, and all other attributes are ignored. See below for the columns returned by the query and type of information available.

VERSIONS The query will return one row containig various informations about the driver, ODBC versions and the database engine. See below for the columns returned by the query and type of information available.

CATALOGS The query will return all valid catalog names for the specified datasource. In this case the query has only one column: Catalog.

SCHEMAS The query will return all valid schema names for the specified datasource. In this case the query has only one column: Schema.

TABLETYPES The query will return all valid table type names for the specified datasource. In this case the query has only one column: TableType.

TABLES The query will return a list of table names and types for the specified datasource. See below for the columns and type of information available.

COLUMNTYPES The query will return all valid column types names for the specified datasource. See below for the columns returned by the query and type of information available.

COLUMNS The query will return a list of columns names and types for the tables specified by the TABLE attribute. See below for the columns and type of information available.

PROCEDURES (New in version 2.0) The query will return a list of procedures defined in the datasource. See below for the columns and type of information available.

INDEXES The query will return a list of all indexes in a specified table. See below for the columns and type of information available.

PRIMARYKEYS (New in version 2.0) The query will return a list of all primary keys in a specified table. See below for the columns and type of information available.

Note: Since primary keys are not supported by the Access ODBC driver, this attribute may not be used with Access databases.

FOREIGNKEYS (New in version 2.0) The query will return:

See below for the columns and type of information available.

Note: Since foreign keys are not supported by the Access ODBC driver, this attribute may not be used with Access databases.

No "DATASOURCES"
DATASOURCE= Name of one datasource in which to look for information.

If this attribute is omitted, the tag will return information about all datasources defined on the system and is equivalent to SELECT="DATASOURCES"

No  
USERNAME= A valid user name if necessary to connect to the datasource. No  
PASSWORD= User's password if necessary to connect to the datasource.

Note: Username and password must be given if they are necessary to connect to the database, even if they are already defined in the ColdFusion administrator settings, because the ODBCInfo tag makes its own SQL connections and is not aware of default ColdFusion settings.

No  
CATALOG= This attribute may be used to restrict information about tables belonging to certain catalog names. See below for the columns and type of information available. If omitted, tables in all catalogs will be searched. This attribute accepts usual SQL search patterns including character % and may result in a group of catalog names. No  
SCHEMA= This attribute may be used to restrict information about tables belonging to certain schema names. See below for the columns and type of information available. If omitted, tables in all schemas will be searched. This attribute accepts usual SQL search patterns including character % and may result in a group of schema names. No  
TABLE= If this attribute is defined, ODBCInfo will return the list of columns in the table. See below for the columns and type of information available.

The name in the TABLE attribute may be a patern like in SQL command and be used to search for several tables name in the datasource.
Ex: "user%" to look for all tables starting with "user".
See below for the columns and type of information available.

If this attribute is omitted, the tag will return information about all tables in the datasource.

-No

-Yes if COLUMN is included.

 
PROCEDURE= (New in version 2.0) If this attribute is defined, ODBCInfo will return the list of input and output parameters, as well as the columns that make up the result set for the specified procedures. See below for the columns and type of information available.

The name in the PROCEDURE attribute may be a patern like in SQL command and be used to search for several procedures name in the datasource.
Ex: "user%" to look for all procedures starting with "user".

If this attribute is omitted but SELECT="procedures", the tag will return information about all procedures defined in the datasource.

-No  
PKCATALOG= (New in version 2.0) Primary key table catalog name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
PKSCHEMA= (New in version 2.0) Primary key table schema name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
PKTABLE= (New in version 2.0) Primary key table name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
FKCATALOG= (New in version 2.0) Foreign key table catalog name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
FKSCHEMA= (New in version 2.0) Foreign key table schema name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
FKTABLE= (New in version 2.0) Foreign key table name; used in conjunction with SELECT="foreignKeys" only. The value cannot contain a string search pattern. No  
UNIQUE This attribute may be used in conjunction with the SELECT="INDEXES" feature in order to limit the query results to unique indexes only. No No
TABLETYPE= This attribute may be used to specify one or more specific table types to search for information. Classical table types may be TABLE, SYSTEM TABLE, SYNONYM, VIEW, etc. Use a CFX_ODBCInfo with SELECT="TABLETYPES" to have a list of all valid types in your datasource. No "TABLE"
COLUMN= If this attribute is defined, ODBCInfo will return information about the specified columns in the table. See below for the columns and type of information available.

The name in the COLUMN attribute may be a patern like in SQL command and be used to search for several column names in the table.
Ex: "user%" to look for all colums starting with "user".
See below for the columns and type of information available.

If this attribute is omitted, the tag will return information about all columns in the table.

No  
ORDERBY= This attribute may be used to order the query by one or two columns. The string passed to ORDERBY is a comma separated list of one or two column names, in a way similar to the SQL syntax. By default, the columns will be listed in their natural sequential order as defined in the datasource. No  

QUERY COLUMNS

List of datasources

This query is returned when SELECT="DATASOURCES" or the attribute DATASOURCE is omitted.
The query has the following columns:
Column Name Description of Content
Name Name of the datasource
Description Name of the ODBC driver used by the datasource

List of drivers

This query is returned when SELECT="DRIVERS".
The query has the following columns:
Column Name Description of Content
Name Name of the driver
Description Driver attribute keywords. (Don't know if some one may ever use it, but the info is there.)

General infos about the ODBC driver and database system

This query is returned when SELECT="VERSIONS".
The query has the following columns:
Column Name Description of Content
Name Name of the datasource
DriverName A character string with the filename of the driver used to access the data source.
DriverODBCVersion A character string with the version of ODBC that the driver supports. The version is of the form ##.##, where the first two digits are the major version and the next two digits are the minor version.
DriverVersion A character string with the version of the driver and, optionally a description of the driver. At a minimum, the version is of the form ##.##.####, where the first two digits are the major version, the next two digits are the minor version, and the last four digits are the release version.
ODBCVersion A character string with the version of ODBC to which the Driver Manager conforms. The version is of the form ##.##, where the first two digits are the major version and the next two digits are the minor version.
DatabaseName A character string with the name of the current database in use, if the data source defines a named object called "database."
DBMSName A character string with the name of the DBMS product accessed by the driver.
DBMSVersion A character string indicating the version of the DBMS product accessed by the driver. The version is of the form ##.##.####, where the first two digits are the major version, the next two digits are the minor version, and the last four digits are the release version. The driver must render the DBMS product version in this form, but can also append the DBMS product-specific version as well. For example, "04.01.0000 Rdb 4.1".
ServerName A character string with the actual data source-specific server name; (ex: ACCESS, Visual FoxPro, etc).

List of catalog names

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="CATALOGS".
The query has the following column:
Column Name Description of Content
Catalog Name of the catalog

List of schema names

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="SCHEMAS".
The query has the following column:
Column Name Description of Content
Schema Name of the schema

List of table type names

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="TABLETYPES".
The query has the following column:
Column Name Description of Content
TableType Name of the table type (ie: TABLE, SYSTEM TABLE, VIEW,...)

List of tables

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="TABLES".
The query has the following columns:
Column Name Description of Content
Catalog Catalog name; it returns an empty string ("") for those tables that do not have catalogs.
Schema Schema name; it returns an empty string ("") for those tables that do not have schemas.
TableName Table name.
TableType Table type name; one of the following: “TABLE”, “VIEW”, “SYSTEM TABLE”, “GLOBAL TEMPORARY”, “LOCAL TEMPORARY”, “ALIAS”, “SYNONYM”, or a data source – specific type name.
TableDescription A description of the table.

List of procedures

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="PROCEDURES".
The query has the following columns:
Column Name Description of Content
Catalog Catalog name; it returns an empty string ("") for those tables that do not have catalogs.
Schema Schema name; it returns an empty string ("") for those tables that do not have schemas.
ProcName Procedure name.
ProcType Procedure type name; one of the following:
  • PROCEDURE: the returned object is a procedure; that is, it does not have a return value.
  • FUNCTION: the returned object is a function; that is, it has a return value.
  • UNKNOWN: it cannot be determined whether the procedure returns a value.
Remark A description of the procedure.

List of possible column types

This query is returned when the attribute DATASOURCE contains a valid datasource name, and SELECT="COLUMNTYPES".
The query has the following columns:
Column Name Description of Content
TypeName Data source-dependent data type name; for example, "CHAR", "VARCHAR", "MONEY", "LONG VARBINARY", or "CHAR ( ) FOR BIT DATA". Applications must use this name in CREATE TABLE and ALTER TABLE statements.
Precision The maximum precision of the data type on the data source. N/A is returned for data types where precision is not applicable. For more information on precision, see Precision, Scale, Length, and Display Size.
LiteralPrefix* Character or characters used to prefix a literal; for example, a single quote ( ' ) for character data types or 0x for binary data types; An empty string is returned for data types where a literal prefix is not applicable.
LiteralSuffix* Character or characters used to terminate a literal; for example, a single quote ( ' ) for character data types; NULL is returned for data types where a literal suffix is not applicable.
Nullable* “NO” if the column does not include NULLs. “YES” if the column could include NULLs.

This column returns an empty string if nullability is unknown.

CaseSensitive Whether a character data type is case sensitive in collations and comparisons:
"YES" if the data type is a character data type and is case sensitive.
"NO" if the data type is not a character data type or is not case sensitive.
Searchable* How the data type is used in a WHERE clause. May be one of the following strings:
UNSEARCHABLE if the data type cannot be used in a WHERE clause.
LIKE_ONLY if the data type can be used in a WHERE clause only with the LIKE predicate.
ALL_EXCEPT_LIKE if the data type can be used in a WHERE clause with all comparison operators except LIKE.
SEARCHABLE if the data type can be used in a WHERE clause with any comparison operator.
UNKNOWN.
Unsigned* Whether the data type is unsigned: "YES", "NO" or "N/A".
Money* Whether the data type is a money data type: "YES", "NO" or "N/A".
AutoIncrement* Whether the data type is autoincrementing: "YES", "NO" or "N/A". An application can insert values into a column having this attribute, but cannot update the values in the column.
Caution: a COUNTER type in Access is not considered as having the AUTOINCREMENT status since it cannot be inserted a value at all.
* Note : these columns are also returned in COLUMNS request.

List of columns

This query is returned when the attribute DATASOURCE contains a valid datasource name, TABLE contains a valid table name in the datasource and SELECT="COLUMNS", or PROCEDURE contains a valid procedure name. In the later case, the query returns an extra columns: ProcColumnType.
The query has the following columns:
Column Name Description of Content
Catalog Catalog name; it returns an empty string ("") for those tables that do not have catalogs.
Shema Schema name; it returns an empty string ("") for those tables that do not have schemas.
TableName/ProcName Table or procedure name. The query uses TableName for tables or ProcName for procedures
ColumnName Column name. The driver returns an empty string for a column that does not have a name.
Type Data source – dependent data type name; for example, “CHAR”, “VARCHAR”, “MONEY”, “LONG VARBINAR”, or “CHAR ( ) FOR BIT DATA”.
Size If DATA_TYPE is SQL_CHAR or SQL_VARCHAR, then this column contains the maximum length in characters of the column. For datetime data types, this is the total number of characters required to display the value when converted to characters. For numeric data types, this is either the total number of digits or the total number of bits allowed in the column, according to the NUM_PREC_RADIX column. For interval data types, this is the number of characters in the character representation of the interval literal (as defined by the interval leading precision).
BufferLength The length in bytes of data transferred in a query operation. For numeric data, this size may be different than the size of the data stored on the data source. This value is the same as the COLUMN_SIZE column for character or binary data.
DecimalDigits The total number of significant digits to the right of the decimal point, depending on the data type. For SQL_TYPE_TIME and SQL_TYPE_TIMESTAMP, this column contains the number of digits in the fractional seconds component. For the other data types, this is the decimal digits of the column on the data source. For interval data types that contain a time component, this column contains the number of digits to the right of the decimal point (fractional seconds). This column is empty for data types where decimal digits is not applicable.
NumPrecRadix For numeric data types, either 10 or 2. If it is 10, the values in COLUMN_SIZE and DECIMAL_DIGITS give the number of decimal digits allowed for the column. For example, a DECIMAL(12,5) column would return a NUM_PREC_RADIX of 10, a COLUMN_SIZE of 12, and a DECIMAL_DIGITS of 5; a FLOAT column could return a NUM_PREC_RADIX of 10, a COLUMN_SIZE of 15 and a DECIMAL_DIGITS of NULL.

If it is 2, the values in COLUMN_SIZE and DECIMAL_DIGITS give the number of bits allowed in the column. For example, a FLOAT column could return a RADIX of 2, a COLUMN_SIZE of 53, and a DECIMAL_DIGITS of NULL.

This column is empty for data types where NUM_PREC_RADIX is not applicable.

Description A description of the column.
Default The default value of the column. The value in this column should be interpreted as a string if it is enclosed in quotation marks.
If NULL was specified as the default value, then this column is the word NULL, not enclosed in quotation marks. If the default value cannot be represented without truncation, then this column contains TRUNCATED, with no enclosing single quotation marks. If no default value was specified, then this column is NULL.
Ordinal The ordinal position of the column in the table. The first column in the table is number 1.
Nullable* “NO” if the column does not include NULLs. “YES” if the column could include NULLs.

This column returns an empty string if nullability is unknown.

LiteralPrefix* Character or characters used to prefix a literal; for example, a single quote ( ' ) for character data types or 0x for binary data types; NULL is returned for data types where a literal prefix is not applicable.
LiteralSuffix* Character or characters used to terminate a literal; for example, a single quote ( ' ) for character data types; NULL is returned for data types where a literal suffix is not applicable.
Params
(New in version 2.0)
A list of keywords, separated by commas, corresponding to each parameter that the application may specify in parentheses when using the name that is returned in the TYPE_NAME field. The keywords in the list can be any of the following: length, precision, or scale. They appear in the order that the syntax requires them to be used. For example, CREATE_PARAMS for DECIMAL would be "precision,scale"; CREATE_PARAMS for VARCHAR would equal "length." NULL is returned if there are no parameters for the data type definition; for example, INTEGER. The driver supplies the CREATE_PARAMS text in the language of the country/region where it is used. .
Searchable* How the data type is used in a WHERE clause. May be one of the following strings:
UNSEARCHABLE if the data type cannot be used in a WHERE clause.
LIKE_ONLY if the data type can be used in a WHERE clause only with the LIKE predicate.
ALL_EXCEPT_LIKE if the data type can be used in a WHERE clause with all comparison operators except LIKE.
SEARCHABLE if the data type can be used in a WHERE clause with any comparison operator.
UNKNOWN.
Unsigned* Whether the data type is unsigned: "YES", "NO" or "N/A".
Money* Whether the data type is a money data type: "YES", "NO" or "N/A".
AutoIncrement* Whether the data type is autoincrementing: "YES", "NO" or "N/A". An application can insert values into a column having this attribute, but cannot update the values in the column.
Caution: a COUNTER type in Access is not considered as having the AUTOINCREMENT status since it cannot be inserted a value at all.
ProcColumnType This column is return only for procedures. Defines the procedure column as a parameter or a result set column. This ca take the following values:
  • INPUT: the procedure column is an input parameter.
  • OUTPUT: the procedure column is an output parameter.
  • INP/OUT: the procedure column is an input/output parameter.
  • RETURNVALUE: the procedure column is the return value of the procedure.
  • RESULTSETCOLUMN: the procedure column is a result set column.
  • UNKNOWN: the procedure column is a parameter whose type is unknown.

List of indexes

This query is returned when the attribute DATASOURCE contains a valid datasource name, TABLE contains a valid table name in the datasource, and SELECT="INDEXES".
The query has the following columns:
Column Name Description of Content
IndexName Index name.
ColumnName Name of the indexed column.
Order
(New in version 2.0)
Sort sequence for the column: "A" for ascending; "D" for descending; An empty string is returned if column sort sequence is not supported by the data source.
Unique YES if the index contains unique keys, NO othewise
Filter
(New in version 2.0)
If the index is a filtered index, this is the filter condition, such as SALARY > 30000; if the filter condition cannot be determined, or if there the index has no filter condition, this is an empty string.
* Note : these columns are also returned in COLUMNTYPES request.

Depending on the type of ODBC driver, a couple of these columns may not be defined. In this case, the column will contain the string "N/A".

List of primary keys in a table (New in version 2.0)

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="PRIMARYKEYS".
The query has the following columns:
Column Name Description of Content
Catalog Primary key table catalog name; it returns an empty string ("") for those tables that do not have catalogs.
Schema Primary key table schema name; it returns an empty string ("") for those tables that do not have schemas.
Table Primary key table name.
Column Primary key column name. The ODBC driver returns an empty string for a column that does not have a name.
Name Primary key name. EMPTY if not applicable to the data source.
Squence Column sequence number in key (starting with 1).

List of foreign keys in a table or refering to a table (New in version 2.0)

This query is returned when the attribute DATASOURCE contains a valid datasource name and SELECT="FOREIGNKEYS".
The query has the following columns:
Column Name Description of Content
PKCatalog Primary key table catalog name; it returns an empty string ("") for those tables that do not have catalogs.
PKSchema Primary key table schema name; it returns an empty string ("") for those tables that do not have schemas.
PKTable Primary key table name.
PKColumn Primary key column name. The ODBC driver returns an empty string for a column that does not have a name.
PKName Primary key name. EMPTY if not applicable to the data source.
FKCatalog Foreign key table catalog name; it returns an empty string ("") for those tables that do not have catalogs.
FKSchema Foreign key table schema name; it returns an empty string ("") for those tables that do not have schemas.
FKTable Foreign key table name.
FKColumn Foreign key column name. The ODBC driver returns an empty string for a column that does not have a name.
FKName Foreign key name. EMPTY if not applicable to the data source.
Sequence Column sequence number in key (starting with 1).

EXAMPLES

All these examples use the cfexamples database which is normally installed with ColdFusion.
The folowing code is an example which may be used to specify background colors for the table generated by the tag:

<STYLE>
TABLE {background-color: FFFCF9} 
TH {background-color: FFBF80} 
</STYLE>
<body BGCOLOR="FFE7CC">

List all Datasources

<CFX_ODBCInfo DUMP="YES">

List all Drivers

<CFX_ODBCInfo SELECT="DRIVERS" DUMP="YES">

List all table types in "CFExamples" ColdFusion sample Database

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="TABLETYPES" 
  DUMP="YES">

List all column types in "CFExamples" ColdFusion sample Database

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="COLUMNTYPES" 
  DUMP="YES">

List all tables in "CFExamples" ColdFusion sample Database

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="TABLES" 
  DUMP="YES">

List all indexes in table tblDocEx in "CFExamples" ColdFusion sample Database

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="INDEXES" 
  DUMP="YES">

List unique indexes in table tblDocEx in "CFExamples" ColdFusion sample Database

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="INDEXES" UNIQUE
  DUMP="YES">

List columns in table tblEmp in CFExamples

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="COLUMNS" 
  TABLE="tblEmp" 
  DUMP="YES">

Alphabetical list of columns in all tables in CFExamples

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="COLUMNS" 
  TABLE="%" 
  DUMP="YES" 
  ORDERBY="columnName,tableName">

List columns in all tables with name containing string "pb" in CFExamples

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="COLUMNS" 
  TABLE="%pb%" 
  DUMP="YES">

List all columns with names containing "ID" in all tables in CFExamples

<CFX_ODBCInfo DATASOURCE="CFExamples" 
  SELECT="COLUMNS" 
  TABLE="%" 
  COLUMN="%ID%" 
  DUMP="YES">

List Versions

<CFX_ODBCInfo DATASOURCE="CFExamples"
	SELECT="versions" DUMP="yes">

List supported features

<CFX_ODBCInfo DATASOURCE="CFExamples"
	SELECT="support" DUMP="yes">

List all Primary keys in table "Order Details" in datasource MSSQL

<CFX_ODBCInfo DATASOURCE="MSSQL" USERNAME="sa" 
	SELECT="primarykeys" TABLE="Order Details" DUMP="yes">

List all foreign keys in table "Order Details" that refer to the primary key of the table "Orders" in datasource MSSQL

<CFX_ODBCInfo DATASOURCE="MSSQL" USERNAME="sa" 
	SELECT="foreignkeys" FKTABLE="Order Details" PKTABLE="Orders" DUMP="yes">

Select a datasource