Results 1 to 5 of 5

Thread: Primary key

  1. #1
    Join Date
    Apr 2009
    Posts
    3

    Question Unanswered: Primary key

    Hi i have got a Table Price

    where PRICE table has

    PRODID
    STDPRICE
    MINPRICE
    STARTDATE
    ENDDATE

    PRODUCT table
    PRODID
    PRODDESC

    i wanaa find how many field(s) has the primary key in PRICE Table.?? and i am unable to understand which has got the unique key.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2009
    Posts
    3
    Like how do i do ?

    i am unable to get u Plz explain in detail i m new to oracle.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    In SQL*Plus, describe ALL_CONSTRAINTS and ALL_CONS_COLUMNS. Then choose one constraint and select * from those two that refers to that constraint. Then write another SELECT statement which will combine ALL_CONSTRAINTS and ALL_CONS_COLUMNS in order to produce nice output.

    Once you produce the query (but you aren't satisfied with it), you may come back and ask for additional help.

  5. #5
    Join Date
    Apr 2009
    Posts
    30
    Hello gaganpreet34 !

    You can qry to ALL_CONSTRAINTS and ALL_CONS_COLUMNS.These 2 are Data Dictionary views.This contains the information about your table.for this you can use following qry...
    select * from ALL_CONSTRAINTS where table_name='price'
    after fire this qry you can find out the CONSTRAINT_NAME, COLUMN_NAME,POSITION.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •