Re: how to list all databases?
Posted in 1997
--------------BB863B174D7320790F67A818
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Heckers schrieb:
> We used to write an esql/c program to do an
> update statistics medium every night.> But we have to support a lot of different platforms
> now and so I wrote a ksh-script, that does the
> same job.
> I use oncheck -pc to get a list of all all databases
> and use this list to do an update statistics with
> dbaccess.
> But oncheck is very slow!
> Who knows a faster method, I don't know much about the
> system tables, but maybe there is a better method using
> dbschema etc..
>
> Should be something like
> <command> |grep [-v ] xxx | awk '{print $i}'
> or
> dbaccess <<EOF
> SQL-COMMANDS
> EOF
>
> Thankx,
> Erik
You might try the following:
dbaccess << EOF
database sysmaster;
select name from sysdatabases where not name = "sysmaster";EOF
Of course, you must do something with the output to get rid of things
like "database selected" or "3 row(s) retrieved".
Regards
Helmut
--------------BB863B174D7320790F67A818
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Heckers schrieb:
<BLOCKQUOTE TYPE=CITE>We used to write an esql/c program to do an
<BR>update statistics medium every night.
<BR>But we have to support a lot of different platforms
<BR>now and so I wrote a ksh-script, that does the
<BR>same job.
<BR>I use oncheck -pc to get a list of all all databases
<BR>and use this list to do an update statistics with
<BR>dbaccess.
<BR>But oncheck is very slow!
<BR>Who knows a faster method, I don't know much about the
<BR>system tables, but maybe there is a better method using
<BR>dbschema etc..
<P>Should be something like
<BR><command> |grep [-v ] xxx | awk '{print $i}'
<BR>or
<BR>dbaccess <<EOF
<BR>SQL-COMMANDS
<BR>EOF
<P>Thankx,
<BR> Erik</BLOCKQUOTE>
You might try the following:
<P><TT>dbaccess << EOF</TT>
<BR><TT>database sysmaster;</TT>
<BR><TT>select name from sysdatabases where not name = "sysmaster";</TT>
<BR><TT>EOF</TT>
<BR><TT></TT>
<P>Of course, you must do something with the output to get rid of things
like "database selected" or "3 row(s) retrieved".
<P>Regards
<BR>Helmut</HTML>
--------------BB863B174D7320790F67A818--