Re: dbschema output
Posted in 1996
} From rmy.emory.edu!informix-list-owner@caig2.att.att.com Fri Aug 9 14:29:02 1996
} >Received: by cagw2.att.com; Fri Aug 9 14:27 EDT 1996
} From: Fred Krefting <krefting@netins.net>
} Subject: Re: dbschema output
} Sender: informix-list-owner@rmy.emory.edu
} To: informix-list@rmy.emory.edu
} X-Informix-List-To: rajivp@qsun.ho.att.com
} X-Informix-List-Id: <news.26969>
} Content-Type: text
}
} Richard Thomas wrote:
} >
} > Hi everyone!
} >
} > Apologies in advance if I'm being thick, but I've read the manual,
} > and it doesn't seem to help. (OK, I'm using OnLine 7.13 and we've
} > only got v6.00 manuals, but that's another story!). What I want
} > are the create table statements for all tables in a database, but
} > without the triggers, procedures, privileges etc. I know I can do
} > a full dbschema and then edit the file, but it's a bit lengthy!!
} >
} > Is there an easier way to do this? (I'm want to get a single file
} > that I can load into S-Designor to get a "pretty picture" of my
} > database structure - it's documentation time!!).
} >
} > TIA,
} >
} > Richard.How about:
}
} dbaccess yourdatabase <<! > tablelist
} select tabname from systables
} where tabid > 99 and tabtype = "T";
} !
}
} for TABLES in `cat tablelist`
} do
} dbschema -d yourdatabase -t $TABLES $TABLES.sql
} done
}
} cat *.sql > alltables
}
} Of course you will probably have to remove the header from the file
} tablelist, or just ignore the error.
}
}
}
}
To not include the header in the dbschema output use the -q flag.
i.e
dbschema -q -d database -t table_name table_name.sql
Hope this helps
--
Rajiv Jhaveri
DBA
=================================================================
Voice : (908) 949 7987 Pager : 544 7872 or
1-800 225 0256 PIN 310902
Fax : (908) 949 1726 E-mail: rajivp@qsun.ho.att.com
=================================================================