Skip to main content
Participating Frequently
April 15, 2008
Question

cfdbinfo question

  • April 15, 2008
  • 3 replies
  • 484 views
I'm trying to find out the name of a DB that a datasource is using (no access to the administrator). My understanding of the cfdbinfo tag is that it can return the DB name used in the datasource. However, when I try to display it, it returns ALL the names of the different DBs that exist. How is this possible? Shouldn't it be a single value?

<cfdbinfo name="GetDBName" datasource="#dsource#" type="dbnames">
<cfoutput query="GetDBName">
<strong>the DB is #database_name#</strong><br>
</cfoutput>


    This topic has been closed for replies.

    3 replies

    Inspiring
    April 17, 2008
    i am using mysql, and cfdbinfo returns me a list of ALL my datasources,
    not even just mysql.

    does anyone think the docs on cfdbinfo are very misleading?:

    cfdbinfo
    Description
    Lets you retrieve information about a data source, including details
    about the database, tables, queries, procedures,
    foreign keys, indexes, and version information about the database,
    driver, and JDBC.
    Usage
    Use the cfdbinfo tag to return a query object that contains information
    about a database. The query object varies,
    depending on the value that you specify in the type attribute.

    it reads to me as it should retrieve info only about one requested ds...


    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Mr_VballAuthor
    Participating Frequently
    April 17, 2008
    quote:

    Originally posted by: Newsgroup User
    i am using mysql, and cfdbinfo returns me a list of ALL my datasources,
    not even just mysql.

    does anyone think the docs on cfdbinfo are very misleading?:

    cfdbinfo
    Description
    Lets you retrieve information about a data source, including details
    about the database, tables, queries, procedures,
    foreign keys, indexes, and version information about the database,
    driver, and JDBC.
    Usage
    Use the cfdbinfo tag to return a query object that contains information
    about a database. The query object varies,
    depending on the value that you specify in the type attribute.

    it reads to me as it should retrieve info only about one requested ds...


    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/



    LOL - hence my question - the docs make it sould like the tag is supposed to return a single value for the DB name. But it returns the entire list. Guess I need to improvise a little. (BTW- I'm using SQL Server)
    Participating Frequently
    April 16, 2008
    As a follow up, I just tried it again with MySQL and it returned to result. The information_schema and the name of the DB that the DSN asked for. So I am guessing that you, like me, are using Oracle.
    Participating Frequently
    April 16, 2008
    <cfdbinfo /> will provide the names of all of the DBs that the user who logged in through the DSN has access to. I know that as an Oracle user, I have access to many DBs and that when I create a DSN it does not ask me for a Database name, just a user/pass. Then cfdbinfo returns all of the DBs I have access to see.