0

hi...
I am beginner for Oracle. Please anyone can tell me how we can assign primary key in to a particular field???????

5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by yash_792
0

There are 2 ways to do it:
- as part of the create table statment like this
create table tab_1 (col1 number, col2 number, col3 number,
CONSTRAINT PK1 PRIMARY KEY (col1)) ;
- alter table tab_1 add CONSTRAINT PK1 PRIMARY KEY (col1) ;

Enjoy.

Yaakov

0

As a beginner, it is absolutely essential that you obtain Oracle reference material. This system is not something that you learn as you go without wasting literally hundreds, probable thousands, of hours. Worse, you could easily create a collection of tables and views that run, but that do so so very slowly that you may find yourself starting over. Or believing that Oracle was a waste of time, which it is not.

Be assured: The manuals are needed. Personally, I have a CD from Oracle, "On-Line Generic Documentaion", that includes ALL the manuals (back at Oracle8, but I find little need for the more recent features :) )

I have a number of macros in my toolkit that I'd be happy to share, once you are at a level that could use them.

I don't wish to sound snotty, really; just advising you on what my learning experience, decades ago, taught me.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.