Jump to content

rawr215

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by rawr215

  1. I just did my sql homework and i had to do the same thing i found this site was useful:http://www.cs.wisc.edu/~dbbook/openAccess/...e_guide.html#oc

    Observing ConstraintsOften you may wish to see what constraints exist on a table. The view USER_CONSTRAINTS is maintained by Oracle and has information about constraints. Some interesting columns include, the CONSTRAINT_NAME, CONSTRAINT_TYPE where P refers to primary key, and R is a foreign key constraints, the TABLE_NAME on which it is defined, and the R_CONSTRAINT_NAME for foreign key constraints. Type DESCRIBE USER_CONSTRAINTS for more informaion.Once you know the CONSTRAINT_NAME, you can use the USER_CONS_COLUMNS view to find the COLUMN_NAME and POSITION for that CONSTRAINT_NAME. You can query these views as you would any other table:select column_name, position, constraint_name from User_cons_columns;
  2. wiki is a good idea, there are tons of other information that maybe useful that are not covered in the tutorialsfor example, contraints in SQL should be something basic that should be covered. and if wiki was implemented, i bet someone would do provide info on it(me maybe? ^__^)

×
×
  • Create New...