Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - 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
Sender: 25fa.4044cbc4.1804289383@sybase.com
From: Johnny
Newsgroups: ianywhere.public.general
Subject: Listing all database names in a server
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <4044cc71.2606.846930886@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 2 Mar 2004 10:03:29 -0800, 10.22.241.42
Lines: 2
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 2 Mar 2004 10:01:38 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 2 Mar 2004 10:02:50 -0800
X-Trace: forums-1-dub 1078250570 10.22.108.75 (2 Mar 2004 10:02:50 -0800)
X-Original-Trace: 2 Mar 2004 10:02:50 -0800, forums-master.sybase.com
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\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4044cc71.2606.846930886@sybase.com>
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
NNTP-Posting-Host: surfec007.sybase.com
X-Original-NNTP-Posting-Host: surfec007.sybase.com
Message-ID: <404564b4@forums-1-dub>
Date: 2 Mar 2004 20:53:08 -0800
X-Trace: forums-1-dub 1078289588 199.93.176.7 (2 Mar 2004 20:53:08 -0800)
X-Original-Trace: 2 Mar 2004 20:53:08 -0800, surfec007.sybase.com
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:

begin
-- 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;
end

--

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!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

<Johnny> wrote in message news:4044cc71.2606.846930886@sybase.com...
> How do I get a listing using Sybase Central?