Re: data model
Posted in 1999
Kirt
To know which version of Online you are running, execute
onstat -Vat the shell prompt. This will tell you.
In your database, do you have FKs defined? Just to check, run dbaccess at
the command prompt and check
Query:Table:Info:cOnstraints:Reference:Referencing to see a list. You can
also look at the catalog table sysconstraints to check for constrtype =
"R". Here is one I just cooked up, havent checked it real well, but seems
to work.
select
a.constrname,
c.tabname fk_child,
d.tabname fk_parent
from
sysconstraints a,
sysreferences b,
systables c,
systables d
where
a.constrtype = "R"
and a.constrid = b.constrid
and c.tabid = a.tabid
and d.tabid = b.tabid
HTH
Sujit
kirt <kirtt@mediaone.net> on 04/29/99 08:47:00 PM
Please respond to kirt <kirtt@mediaone.net>
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: data model
hi all
let me start by saying a D.B.A. I'm not. I have a database with over 100
tables and some table have over 130 columns. I do not know which version
of
online we are running. I do have root access on our AIX v4.2.1 H50's.
I am trying to build a data model from the info I do have. The table names
and column content type. The foreign keys are what I don't have. Is there
a
command I can include in a korn shell script that will tell me which
columns
are foreign keys and to were they point.
Also a command to tell me the version would be nice.
Obviously I did not build this database I adopted it
Thanks
kirt