Oracle and The CFDBINFO tag: More Tables Than I Bargained For

I was trying out the ColdFusion 8 <cfdbinfo> tag for the first time today, attempting to retrieve the names of all of the tables in a particular Oracle datasource. I used a <cfdump> to return the results, and I was startled to see a query object containing over 2,000 records.

A bit more than the 35 records I was expecting.

All of the unexpected entries were system tables or views. I have no idea what purpose they serve or if they're even part of the datasource per se.

It's possible it's an anomaly resulting from the way our DBAs have our Oracle server configured, rather than something that will affect anyone trying to use the <cfdbinfo> tag against an Oracle database, but I thought it worth sharing.

Fortunately, I should be able to use the "pattern" attribute of <cfdbinfo> to retrieve just the tables I need for my purpose.

Comments
I filed an bug report/enhancement on this a while back. There really needs to be an "owner" attribute for use with an Oracle datasource, otherwise, as you've seen, you get tables and views owned by all users(including SYS) in your database. If you "only" got 2000 records, consider yourself lucky. This tag is pretty much unusable with Oracle datasources as it stands.
# Posted By joel | 2/13/08 3:01 PM
So it's not just me/my organization's Oracle server.

I agree then that the tag needs enhancement for use with Oracle, but because so few ColdFusion shops use Oracle as their database (at least that's my perception) I don't know what kind of priority that kind of fix would get.

I was able to still use the tag for my particular need, though: most of my tables include the name or acronym of the app as the prefix of the table name, so using the pattern attribute with the wildcard characters worked out just fine, returning only the tables I needed fairly quickly.

My only gripe with the pattern attribute was there's no way to escape the wildcards, and I did sometimes use the underscore character (one of the wildcards) in my older table names.
# Posted By Brian Swartzfager | 2/13/08 3:28 PM
Don't forget the tag returns a query, so QofQ will work on it...
# Posted By todd sharp | 2/13/08 3:38 PM
@Todd: True, but it would be nice to be able to get the tables you want in one step (either using the pattern attribute or an Oracle-specific attribute to limit the search scope) rather than two, even if you only have to do it once and then persist your results. Saves on execution time.
# Posted By Brian Swartzfager | 2/13/08 4:02 PM
Do you have by any chance DBA role on the Oracle user ? I get the same thing when I use a code generator that does this via JDBC calls and the Oracle user has DBA role.
# Posted By crisp | 2/13/08 5:58 PM
@crisp: To be honest, I don't know, though my guess would be no.
# Posted By Brian Swartzfager | 2/13/08 8:53 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.