If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > List databases in IDS 7.31 in a script.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-10-04, 11:31
trillobit trillobit is offline
Registered User
 
Join Date: Sep 2004
Posts: 1
List databases in IDS 7.31 in a script.

Hi all,

Is there a way to list all databases in Informix 7.31? I know how to connect with dbaccess if the database is known but I have to make a list of databases in a unix shell script before I connect to each one. The reaseon for this is that the amount of databases will vary over time an my script must handle that.

I have tried to use things like "dbaccess -di .." and redirect i to a file and kill the process but that doesn't work very well and the outfile is hard to parse.

Thanks in advance.

Regards
Bernt Jernberg
Reply With Quote
  #2 (permalink)  
Old 10-11-04, 16:19
pan_indy pan_indy is offline
Registered User
 
Join Date: May 2004
Posts: 3
check the sysmaster:sysdatabase table it list all the database in a instance.
Reply With Quote
  #3 (permalink)  
Old 10-12-04, 01:52
supinformix supinformix is offline
Registered User
 
Join Date: Apr 2004
Location: Brussels
Posts: 57
try this one :

for name in `echo "select name from sysdatabases;" | dbaccess sysmaster `

do
echo $name
dbaccess $name - <<eof
-- your stuff
eof

done
__________________
Yves & Willy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On