Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Listing all database names in a server

2 posts in General Discussion Last posting was on 2004-03-03 04:53:08.0Z
Johnny Posted on 2004-03-02 18:02:50.0Z
From: Johnny
Newsgroups: ianywhere.public.general
Subject: Listing all database names in a server
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <>
X-Original-Trace: 2 Mar 2004 10:03:29 -0800,
Lines: 2
X-Original-Trace: 2 Mar 2004 10:01:38 -0800,
Date: 2 Mar 2004 10:02:50 -0800
X-Trace: forums-1-dub 1078250570 (2 Mar 2004 10:02:50 -0800)
X-Original-Trace: 2 Mar 2004 10:02:50 -0800,
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2688
Article PK: 6160

How do I get a listing using Sybase Central?

Chris Keating (iAnywhere Solutions) Posted on 2004-03-03 04:53:08.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <>
Newsgroups: ianywhere.public.general
References: <>
Subject: Re: Listing all database names in a server
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <404564b4@forums-1-dub>
Date: 2 Mar 2004 20:53:08 -0800
X-Trace: forums-1-dub 1078289588 (2 Mar 2004 20:53:08 -0800)
X-Original-Trace: 2 Mar 2004 20:53:08 -0800,
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2694
Article PK: 6167

Using SC, you need to connect to a database hosted on the server and expand
the server folder.

The following script will show the running databases:

-- store the details of the running databases
declare local temporary table serverdatabases (
database_id integer primary key,
database_name varchar(128 )
declare dbid integer; -- database identifier
declare dbname varchar(128); -- database name

-- get the running database list
select next_database( NULL ), db_name( next_database( NULL ) ) into dbid,
dbname from dummy;
while dbid is not null loop
insert into serverdatabases (database_id, database_name ) values ( dbid,
dbname );
select next_database( dbid ), db_name( next_database( dbid ) ) into
dbid, dbname from dummy;
end loop;

-- show the running databases
select database_id, database_name from serverdatabases order by database_id;


Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!


iAnywhere Solutions

** Please only post to the newsgroup

** Whitepapers can be found at
** EBFs can be found at
** Use CaseXpress to report bugs


<Johnny> wrote in message
> How do I get a listing using Sybase Central?