Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Unanswered: 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

  2. #2
    Join Date
    May 2004
    Posts
    3
    check the sysmaster:sysdatabase table it list all the database in a instance.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •