Re: Stored procs and system tables
Posted in 1999
Nayan
You are welcome. But what I meant was instead of running something like:
dbschema -d mydbname -t all mydbname.sql --(1)
you could do:
dbaccess mydbname <<EOF
OUTPUT TO tm_tabs.dat
SELECT tabname FROM systables WHERE tabid > 99 AND tabname MATCHES "tm_*";EOF
and then say something like this (not tested, you would need to strip the
header for one thing).
{
cat tm_tabs.dat | while read tabname
do
dbschema -d mydbname -t $tabnamedone
} >> mydbname_tm.sql
This will give you only the tm_ tables, instead of all tables as command
(1) will. You could package the whole thing into a script for convenience.
But you are probably doing this anyway and I may have misunderstood your
email.
A long time ago. thinking like a programmer, I decided that I needed a
cleaner implementation of this whole thing, and I wrote a generalized 4GL
program that would do this for me, which impressed the resident Informix
DBA no end :-) and really started me off on my DBA career. Since then, I
have started thinking in a more "Unix-y" manner (in the sense of glueing
together available tools to get my work done), so nowadays I prefer this
way instead.
HTH
Sujit
Nayan Jain <nayan.jain@tatainfotech.com> on 06/01/99 10:33:31 AM
To: Sujit Pal
cc: informix-list@iiug.org
Subject: Re: Stored procs and system tables
Hi Sujit !
Thanks for all the replies...
u really have taken pains to reply to so many mails of mine...
BTW, Currently i am running that procedure script from unix shell prompt
also, ur this mail saying me to first finding out the tables from query
and then running a unix script to take dbschema... I have been doing that
thing itself and was just curious to find if there is any easy way out
from dbschema command itself.
Anyway thanks again !
Your replies are valued too much ...
(that goes for all informix list repliers)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
" If you love those who love you, what credit is that to you? "
On Tue, 1 Jun 1999 Sujit.Pal@BankAmerica.com wrote:
>
>
> Nayan
>
> To get a list of database objects, you could try something like this:
>
> SELECT tabname FROM systables WHERE tabname MATCHES "tm_*";>
> Similarly use systriggers for triggers and sysprocedures for procedures.
> You can then pipe the output into a shellscript which calls dbschema and
> appends to a file.
>
> HTH
> Sujit
>
>
>
>
>
> Nayan Jain <nayan.jain@tatainfotech.com> on 05/29/99 12:30:18 AM
>
> To: "Art S. Kagel" <kagel@bloomberg.net>
> cc: informix-list@iiug.org (bcc: Sujit Pal)
> Subject: Re: Stored procs and system tables
>
>
>
>
> Hi !
>
> Sorry i just overlooked this mail, I have another question on this.
> Is there aany way that you can get all the procedures / table schema
> by giving some filter conditions.
>
> I have given the names of tables/procedures/triggers on sub-module names
>
> like "tm_t_table1" - for Table belonging to TM Module
> "sm_t_table2" - for Table belonging to SM Module
>
> Similarly for procedures ..
>
> "tm_sp_proc1" for proc of TM
> "sm_sp_proc2" for proc of SM
>
> Is there any way that i can only get table/proc schema of tables of one
> module. Otherwise there are more than 2000 table and > 1000 procedures
>
> whereas my need is only of 220 tables and 161 procs
>
> TIA,
>
> Nayan !
>
> On Wed, 19 May 1999, Art S. Kagel wrote:
>
> > Michael Talbot wrote:
> > >
> > > Is there a somewhat painless way to extract from the system tables
all
> the
> > > drop and create statements for all user written procedures in a given
> > > database into a single text file .
> > >
> > > I am using Informix ODS 7.14 / HP-UX 10.2
> >
> > You can use "dbschema -d database -f all" or get myschema.ec from my
> > submission, utils2_ak, in the IIUG Software Repository, which does all
> > that dbschema does and MUCH more. BTW the latest version of utils2_ak
> > with a new version of myschema is available as of yesterday. It
> > includes a few bug fixes and new features, also the dbload script
> > generation mode has been updated to work with 7.xx dbload. Also
> > myschema now optionally generates the talbe statistics comment ala
> > dbschema (but it gets the index sizes right unlike dbschema -
> > bug #111832).
> >
> > Art S. Kagel
> >
>
>
>
>
>