Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding constraints in existing database

Re: Finding constraints in existing database

From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: Thu, 09 Mar 2000 03:57:59 GMT
Message-ID: <8a77g6$npe$1@nnrp1.deja.com>


Using my freeware SQLPlusPlus you could easily list constraints (and other
objects) with simple commands in SQL*Plus. For example to list all contraints for the current user, I shall do the following:

SQL> EXEC S.H('LSTCON') -- Display help about LSTCON command
| ----------------------------------------------------------------------




| LSTCON -- List Constraints
| ----------------------------------------------------------------------



| PROCEDURE s.lstcon (tabname IN VARCHAR2 DEFAULT '%',
| own IN VARCHAR2 DEFAULT USER);
|
| ----------------------------------------------------------------------


SQL> EXEC S.LSTCON -- Execute LSTCON command
| TEST DEPT DEPT_PRIMARY_KEY
PRIMARY KEY
| TEST DEPT SYS_C001257
CHECK
| TEST EMP EMP_FOREIGN_KEY
FOREIGN KEY
| TEST EMP EMP_PRIMARY_KEY
PRIMARY KEY
| TEST EMP EMP_SELF_KEY
FOREIGN KEY
| TEST EMP SYS_C001259
CHECK
| TEST EMP SYS_C001260
CHECK
| TEST SQLPP_HELP SYS_C001241
CHECK
| TEST SQLPP_HELP SYS_C001242
CHECK
| TEST SQLPP_HELP SYS_C001243
CHECK
| TEST SQLPP_HELP SYS_C001244
CHECK
| TEST SQLPP_HELP SYS_C001245
CHECK
| TEST SQLPP_HELP SYS_C001246
CHECK
| TEST SQLPP_OUTPUT SYS_C001237
CHECK
| TEST SQLPP_OUTPUT SYS_C001238
CHECK
| TEST SQLPP_OUTPUT SYS_C001239
CHECK
| TEST SQLPP_OUTPUT SYS_C001240
CHECK regards,
M. Armaghan Saqib

+---------------------------------------------------------------

| 1. SQL PlusPlus => Add power to SQL Plus command line
| 2. SQL Link for XL => Integrate Oracle with XL
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
+---------------------------------------------------------------

| SQLPlusPlus now on http://www.ioug.org/
| "PL/SQL package that extends SQL*Plus to another dimension.
| Contains a PL/SQL code generator and set of extremely useful
| utilites with extensive documentation." IOUG Web Site
+---------------------------------------------------------------

Kevin Bass <akil1_at_mindspring.com> wrote in message news:89ptja$rf2$1_at_nntp9.atl.mindspring.net... > Try using DBA_CONSTRAINTS (if you have access to it), or USER_CONSTRAINTS.
> Use the fields of constraint_name, owner, table_name in the WHERE clause
for

> the table(s) that contain the constraints.
>
>
> matthew taylor <s176226_at_student.uq.edu.au> wrote in message
> news:38BF684D.2E8C1A6C_at_student.uq.edu.au...
> > a while ago i discovered
> > select * from USER_TABLES;
> >
> > and the resulting flood of information when filtered yielded all
kinds
> > of interesting information.... like all the names of tables in the table
> > space etc.
> >
> > I'm still wading through various manuals to get the hang of things
in
> > Oracle but I'm curious, is there a quick and easy way to find
> > constraints that have been setup on a database?? ie. is it something
> > like
> >
> > select blah from constraints_blah    ???
> >
> >
> > Got myself all happy the other day when I jdbc connected across
network
> > to an access database, now to move onto a jdbc connection across
> > webserver and do some dynamic content in web pages.
> >
> >
> > Matthew
>
>



Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Mar 08 2000 - 21:57:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US