This is a feature first demonstrated in CT yesterday, a new tag in Scorpio named <CFDBINFO> which does just that, it returns information about databases (and data sources, and tables, and columns, and stored procedures, and more). This first code snippet shows how to obtain a list of tables in a specified data source (using the default database):
<cfdbinfo type="tables" datasource="myDSN" name="tables">
To get column details you can do the following:
<cfdbinfo type="columns" datasource="myDSN" table="myTables" name="columns">
This would return a query containing column names, type, size, default values, whether it allows NULL values, key associations, and more.
As you can see, <CFDBINFO> accepts a TYPE attribute which tells it what information you want, and the following types are supported:
- columns: Returns column details for a specific table.
- dbnames: Returns the databases in a specified data source.
- foreignkeys: Returns foreign key name information, including associated primary key, and delete and update rules.
- index: Returns index specifics, including column details, page usage, and whether or not the index is unique.
- procedures: Returns available stored procedures.
- tables: Returns the names of tables within a specific database.
- version: Returns database drive version details.
Yesterday's Scorpio presentations in Connecticut went very well, with over 100 attendees between the two venues.
I'm posting this as I am about to head out the door to drive to Albany, NY for a midday session, and then it is in to New York City for a presentation this evening. So, if you are the area (in NY, or later in the week in NJ, DC, and GA), please drop by.