Help finding tables without Primary Keys
Posted in 2007
Topics: Versions, Editions & End-of-Life
Good morning, I have IDS 10.00.FC5 under HPUX 11.23. If there is a way to query sysmaste= r / data-dictionary to identify tables that don=B9t have a Primary Key, I would be eternally grateful for any assistance. Merci =E0 l'avance Jonathan B. Smaby DBSA Pomona College, ITS-AISO Office jonathan.smaby@pomona.edu Web. http://www.pomona.edu -- "In theory, there is no difference between theory and practice. But, in practice, there is." ~ Jan L. A. Van de Snepscheut (1953-1994) ------------------------------------------------------------- This message has been scanned by Postini anti-virus software. =0D
This is a database level query, not a sysmaster query.
select tabname from systables a
where not exists (select 0
from sysconstraints b
where a.tabid=b.tabid
and constrtype='P')
In short, give me tablenames where there is no matching 'P'rimary
constraint.
j.
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org]On Behalf Of
Jonathan Smaby
Sent: Friday, October 26, 2007 1:14 PM
To: ids@iiug.org
Subject: Help finding tables without Primary Keys [10273]
Good morning,
I have IDS 10.00.FC5 under HPUX 11.23. If there is a way to query sysmaste=
r
/ data-dictionary to identify tables that don=B9t have a Primary Key, I
would
be eternally grateful for any assistance.
Merci =E0 l'avance
Jonathan B. Smaby
DBSA
Pomona College, ITS-AISO Office
jonathan.smaby@pomona.edu
Web. http://www.pomona.edu
--
"In theory, there is no difference between theory and practice. But, in
practice, there is."
~ Jan L. A. Van de Snepscheut (1953-1994)
-------------------------------------------------------------
This message has been scanned by Postini anti-virus software.
=0D
****************************************************************************
***
Forum Note: Use "Reply" to post a response in the discussion forum.
Accessing "dbaccess" , execute the query:
select owner, tabname, tabid, nrows, ncols from systableswhere tabid > 99and
not exists(select 0 as const from sysconstraints where systables.tabid =sysconstraints.% and sysconstraints.constrtype = 'P')Best regards.
Roberto Ferronato
> To: ids@iiug.org> From: Jonathan.Smaby@pomona.edu> Subject: Help finding
tables without Primary Keys [10273]> Date: Fri, 26 Oct 2007 13:13:31 -0400> >
Good morning, > > I have IDS 10.00.FC5 under HPUX 11.23. If there is a way to
query sysmaste= > r > / data-dictionary to identify tables that don=B9t have a
Primary Key, I would > be eternally grateful for any assistance. > > Merci =E0
l'avance > > Jonathan B. Smaby > DBSA > Pomona College, ITS-AISO Office >
jonathan.smaby@pomona.edu > Web. http://www.pomona.edu > > -- > "In theory,
there is no difference between theory and practice. But, in > practice, there
is." > ~ Jan L. A. Van de Snepscheut (1953-1994) > >
------------------------------------------------------------- > This message
has been scanned by Postini anti-virus software. > =0D > > >
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum. >
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
Execute the query by dbaccess:
elect owner, tabname, tabid, nrows, ncols from systableswhere tabid > 99and
not exists(select 0 as const from sysconstraints where systables.tabid =
sysconstraints.tabid and sysconstraints.constrtype = 'P')Best RegardsR.
Ferronato
> To: ids@iiug.org> From: Jonathan.Smaby@pomona.edu> Subject: Help finding
tables without Primary Keys [10273]> Date: Fri, 26 Oct 2007 13:13:31 -0400> >
Good morning, > > I have IDS 10.00.FC5 under HPUX 11.23. If there is a way to
query sysmaste= > r > / data-dictionary to identify tables that don=B9t have a
Primary Key, I would > be eternally grateful for any assistance. > > Merci =E0
l'avance > > Jonathan B. Smaby > DBSA > Pomona College, ITS-AISO Office >
jonathan.smaby@pomona.edu > Web. http://www.pomona.edu > > -- > "In theory,
there is no difference between theory and practice. But, in > practice, there
is." > ~ Jan L. A. Van de Snepscheut (1953-1994) > >
------------------------------------------------------------- > This message
has been scanned by Postini anti-virus software. > =0D > > >
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum. >
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
Jonathan, run the query, by dbaccess <database>:
Select owner, tabname, tabid, nrows, ncols from systableswhere tabid > 99and
not exists(select 0 as const from sysconstraints where systables.tabid =sysconstraints.tabid and sysconstraints.constrtype = 'P')(the column that
matter is 'tabname')
Best regards,
Roberto Ferronato
> To: ids@iiug.org> From: Jonathan.Smaby@pomona.edu> Subject: Help finding
tables without Primary Keys [10273]> Date: Fri, 26 Oct 2007 13:13:31 -0400> >
Good morning, > > I have IDS 10.00.FC5 under HPUX 11.23. If there is a way to
query sysmaste= > r > / data-dictionary to identify tables that don=B9t have a
Primary Key, I would > be eternally grateful for any assistance. > > Merci =E0
l'avance > > Jonathan B. Smaby > DBSA > Pomona College, ITS-AISO Office >
jonathan.smaby@pomona.edu > Web. http://www.pomona.edu > > -- > "In theory,
there is no difference between theory and practice. But, in > practice, there
is." > ~ Jan L. A. Van de Snepscheut (1953-1994) > >
------------------------------------------------------------- > This message
has been scanned by Postini anti-virus software. > =0D > > >
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum. >
_________________________________________________________________
Connect to the next generation of MSN Messenger
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmai
ltagline