<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SQL query to get all database names in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838544#M4869387</link>
    <description>&lt;P&gt;Thanks Breck, will keep this one handy too.:)&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2011 16:40:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-04-04T16:40:05Z</dc:date>
    <item>
      <title>SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaq-p/13838540</link>
      <description>&lt;P&gt;What sql query can give me name of all databases ? 
Like for Sqlserver it is SELECT NAME FROM SYS.DATABASES and for Mysql we can use SHOW DATABASES.
I need to run this sql via a jdbc call.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:06:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaq-p/13838540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838541#M4869384</link>
      <description>&lt;P&gt;Note that unlike some of the other RDBMSes, SQL Anywhere does not have a "master database" so you cannot get a list of all databases that are on a computer.&lt;/P&gt;
&lt;P&gt;Once you are connected to a server you can get the list of all databases running on the server to which you are connected by using&lt;/P&gt;
&lt;LI-CODE lang="sql"&gt;select db_name( number ) from sa_db_list();
&lt;/LI-CODE&gt;
&lt;P&gt;See the &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/sa-db-list-sysproc.html"&gt;documentation&lt;/A&gt; for more information.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838541#M4869384</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2011-04-04T16:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838543#M4869386</link>
      <description>&lt;P&gt;Awesome, thanks Mark, would work for me !
Must say this is thus far the fastest reply I got on any forum &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838543#M4869386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838542#M4869385</link>
      <description>&lt;P&gt;In addition to Mark's SQL query, the dblocate utility can show you everything that's visible on the network:&lt;/P&gt;
&lt;P&gt;This command...
&lt;/P&gt;&lt;PRE&gt;"%SQLANY12%bin32dblocate.exe" -dv -o dblocate.txt
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;produced this file on my workstation...
&lt;/P&gt;&lt;PRE&gt;SQL Anywhere Server Enumeration Utility Version 12.0.1.3298
Server Name           Address
-----------           -------
benchmark             Envy:2638    &lt;BR /&gt;
   Running database: test
   Running database: ddd001
   Running database: ddd002
   Running database: ddd003
   Running database: ddd004
   Running database: ddd005
   Running database: ddd006
   Running database: ddd007
   Running database: ddd008
   Running database: ddd009
   Running database: ddd010
   Running database: ddd011
   Running database: ddd012
   Running database: ddd013
   Running database: ddd014
   Running database: ddd015
   Running database: ddd016
   Running database: ddd017
   Running database: ddd018
   Running database: ddd019
   Running database: ddd020
   Running database: ddd021
   Running database: ddd022
   Running database: ddd023
   Running database: ddd024
   Running database: ddd025
   Running database: ddd026
   Running database: ddd027
   Running database: ddd028
   Running database: ddd029
   Running database: ddd030
   Running database: ddd031
   Running database: ddd032
   Running database: ddd033
   Running database: ddd034
   Running database: ddd035
   Running database: ddd036
   Running database: ddd037
   Running database: ddd038
   Running database: ddd039
   Running database: ddd040
   Running database: ddd041
   Running database: ddd042
   Running database: ddd043
   Running database: ddd044
   Running database: ddd045
   Running database: ddd046
   Running database: ddd047
   Running database: ddd048
   Running database: ddd049
   Running database: ddd050
   Running database: ddd051
   Running database: ddd052
   Running database: ddd053
   Running database: ddd054
   Running database: ddd055
   Running database: ddd056
   Running database: ddd057
   Running database: ddd058
   Running database: ddd059
   Running database: ddd060
   Running database: ddd061
   Running database: ddd062
   Running database: ddd063
   Running database: ddd064
   Running database: ddd065
   Running database: ddd066
   Running database: ddd067
   Running database: ddd068
   Running database: ddd069
   Running database: ddd070
   Running database: ddd071
   Running database: ddd072
   Running database: ddd073
   Running database: ddd074
   Running database: ddd075
   Running database: ddd076
   Running database: ddd077
   Running database: ddd078
   Running database: ddd079
   Running database: ddd080
   Running database: ddd081
   Running database: ddd082
   Running database: ddd083
   Running database: ddd084
   Running database: ddd085
   Running database: ddd086
   Running database: ddd087
   Running database: ddd088
   Running database: ddd089
   Running database: ddd090
   Running database: ddd091
   Running database: ddd092
   Running database: ddd093
   Running database: ddd094
   Running database: ddd095
   Running database: ddd096
   Running database: ddd097
   Running database: ddd098
   Running database: ddd099
   Running database: ddd100
ddd12                 Envy:49160   &lt;BR /&gt;
   Running database: ddd12
ruralfinds            DGRK3X31:2638&lt;BR /&gt;
   Running database: ruralfinds&lt;P&gt;&lt;/P&gt;
&lt;P&gt;3 servers, 103 databases found
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;It is possible for servers to hide from dblocate by starting with the dbsrv12 -sb 0 option.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:34:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838542#M4869385</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-04-04T16:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838544#M4869387</link>
      <description>&lt;P&gt;Thanks Breck, will keep this one handy too.:)&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838544#M4869387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838545#M4869388</link>
      <description>&lt;P&gt;I've tried this on our v10.0.1.3960 databases and all I get is the database I'm connected to, am I missing something obvious ?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838545#M4869388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838546#M4869389</link>
      <description>&lt;P&gt;That's some fine silverware &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838546#M4869389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838547#M4869390</link>
      <description>&lt;P&gt;Daz ,combination of these two queries works for me,via jdbc call&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;SELECT  * FROM sa_db_list() -&amp;gt; will give you all ids to feed to  next query&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;(which is )say in my case 
Select db_name( 0 ), db_name( 1 ),db_name( 2 ) from sa_db_list();&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 04 Apr 2011 17:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838547#M4869390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T17:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838548#M4869391</link>
      <description>&lt;P&gt;I think Mark's select would do the same but show it in rows rather than columns (and without the risk of you trying to query a database that wasn't in the results from sa_db_list), the problem I have is sa_db_list() is only returning one database.&lt;/P&gt;
&lt;P&gt;Unless (as I said before) I'm missing something simple.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 17:40:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838548#M4869391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T17:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838549#M4869392</link>
      <description>&lt;P&gt;The nice thing about this forum is that you can sign up to get an email anytime a new question is ask (or a number of other events). Hence it is easy to "monitor" the forum without actually doing anything since my email client will tell me when I get new email &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 18:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838549#M4869392</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2011-04-04T18:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838550#M4869393</link>
      <description>&lt;P&gt;This will only show you databases running on the current engine/server. If you have multiple instances of SQL Anywhere running, they will need to be queried per-server.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 18:55:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838550#M4869393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T18:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838551#M4869394</link>
      <description>&lt;P&gt;doh, I'd forgotten you could start them up with one dbsrv, we've always used one database per dbsrv. Thanks Tyson.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 03:51:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838551#M4869394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T03:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query to get all database names</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838552#M4869395</link>
      <description>&lt;P&gt;@Daz: ah, the joys of Family Tech Support &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 05:43:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-query-to-get-all-database-names/qaa-p/13838552#M4869395</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-04-05T05:43:08Z</dc:date>
    </item>
  </channel>
</rss>

