Re: dbschema output
Posted in 1996
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.sqldone
cat *.sql > alltables
Of course you will probably have to remove the header from the file
tablelist, or just ignore the error.