Reading Constraints from the database
Posted in 1999
Topics: General Discussion
Hi, I need to do the following using SQL. For any given table I want to find out what are the constraints asscociated with it. eg:- Is there a primary key associated with table ? If yes, what is the primary key ? Is there a foregin key associated?. If so what is the foregin table and column associated ?. Any help is appreciated !!! Thanks _______________________________________________________________ Get Free Email and Do More On The Web. Visit http://www.msn.com
i don't have access to informix db so this is off top of my head. - look at structure of sysconstraints and sysreferences - you'll need to join to sysindexes and syscolumns if you want column names for your keys Kannan Murugan <kannappy@hotmail.com> wrote: > Hi, > I need to do the following using SQL. > For any given table I want to find out what are the constraints asscociated > with it. eg:- > Is there a primary key associated with table ? > If yes, what is the primary key ? > Is there a foregin key associated?. > If so what is the foregin table and column associated ?. > Any help is appreciated !!! > Thanks > _______________________________________________________________ > Get Free Email and Do More On The Web. Visit http://www.msn.com